Froze rails gems
[depot.git] / vendor / rails / actionpack / test / testing_sandbox.rb
diff --git a/vendor/rails/actionpack/test/testing_sandbox.rb b/vendor/rails/actionpack/test/testing_sandbox.rb
new file mode 100644 (file)
index 0000000..c365851
--- /dev/null
@@ -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