Class: ActiveModel::TestCase

Inherits:
ActiveSupport::TestCase
  • Object
show all
Defined in:
lib/active_model/test_case.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#with_kcode(kcode) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/active_model/test_case.rb', line 3

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