aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/test_case.rb
blob: 6328807ad75faabb68a4ed0c17787a205f590ca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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