mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
19 lines
355 B
Ruby
19 lines
355 B
Ruby
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
|