a4c77f9bc4
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
16 lines
274 B
Ruby
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
|