1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/lib/testing_sandbox.rb
2009-05-22 17:17:14 -07:00

15 lines
274 B
Ruby

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