1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/lib/active_model/test_case.rb
2010-01-04 16:22:46 -06:00

16 lines
319 B
Ruby

module ActiveModel #:nodoc:
class TestCase < ActiveSupport::TestCase #:nodoc:
def with_kcode(kcode)
if RUBY_VERSION < '1.9'
orig_kcode, $KCODE = $KCODE, kcode
begin
yield
ensure
$KCODE = orig_kcode
end
else
yield
end
end
end
end