X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factionpack%2Ftest%2Ftesting_sandbox.rb;fp=vendor%2Frails%2Factionpack%2Ftest%2Ftesting_sandbox.rb;h=c36585104f5043d01f626876a58353ff16bfd0d9;hb=d115f2e23823271635bad69229a42cd8ac68debe;hp=0000000000000000000000000000000000000000;hpb=37cb670bf3ddde90b214e591f100ed4446469484;p=depot.git

diff --git a/vendor/rails/actionpack/test/testing_sandbox.rb b/vendor/rails/actionpack/test/testing_sandbox.rb
new file mode 100644
index 0000000..c365851
--- /dev/null
+++ b/vendor/rails/actionpack/test/testing_sandbox.rb
@@ -0,0 +1,15 @@
+module TestingSandbox
+  # Temporarily replaces KCODE for the block
+  def with_kcode(kcode)
+    if RUBY_VERSION < '1.9'
+      old_kcode, $KCODE = $KCODE, kcode
+      begin
+        yield
+      ensure
+        $KCODE = old_kcode
+      end
+    else
+      yield
+    end
+  end
+end