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