aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-22 17:17:14 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-22 17:17:14 -0700
commitda9e53ec3b92fd583346896dd15c5b2533c8af6a (patch)
tree9ca5eea8c06a6f58d932f8920f98fde9824bef5a /actionpack/test/lib
parent8a03a999ef2ed47c7f2ead1a9dd639120c569e03 (diff)
downloadrails-da9e53ec3b92fd583346896dd15c5b2533c8af6a.tar.gz
rails-da9e53ec3b92fd583346896dd15c5b2533c8af6a.tar.bz2
rails-da9e53ec3b92fd583346896dd15c5b2533c8af6a.zip
Move testing_sandbox to test/lib
Diffstat (limited to 'actionpack/test/lib')
-rw-r--r--actionpack/test/lib/testing_sandbox.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/lib/testing_sandbox.rb b/actionpack/test/lib/testing_sandbox.rb
new file mode 100644
index 0000000000..c36585104f
--- /dev/null
+++ b/actionpack/test/lib/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