instiki/vendor/rails/actionpack/test/testing_sandbox.rb
Jacques Distler 5292899c9a Rails 2.1 RC1
Updated Instiki to Rails 2.1 RC1 (aka 2.0.991).
2008-05-17 23:22:34 -05:00

16 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