2007-01-22 07:43:50 -06:00
|
|
|
module TestingSandbox
|
2007-02-09 02:04:31 -06:00
|
|
|
# Temporarily replaces KCODE for the block
|
|
|
|
def with_kcode(kcode)
|
2008-05-17 23:22:34 -05:00
|
|
|
if RUBY_VERSION < '1.9'
|
|
|
|
old_kcode, $KCODE = $KCODE, kcode
|
|
|
|
begin
|
|
|
|
yield
|
|
|
|
ensure
|
|
|
|
$KCODE = old_kcode
|
|
|
|
end
|
|
|
|
else
|
2007-02-09 02:04:31 -06:00
|
|
|
yield
|
2007-01-22 07:43:50 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|