instiki/vendor/rails/actionpack/test/testing_sandbox.rb

16 lines
274 B
Ruby
Raw Normal View History

2007-01-22 14:43:50 +01:00
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
2007-01-22 14:43:50 +01:00
end
end
end