diff options
Diffstat (limited to 'activemodel/lib/active_model/test_case.rb')
-rw-r--r-- | activemodel/lib/active_model/test_case.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/test_case.rb b/activemodel/lib/active_model/test_case.rb new file mode 100644 index 0000000000..4cb5c9cbc0 --- /dev/null +++ b/activemodel/lib/active_model/test_case.rb @@ -0,0 +1,18 @@ +require "active_support/test_case" + +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 |