diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-20 15:07:49 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-20 15:07:49 +0000 |
commit | 60756ad4ece2298e85353ed50853f1d260e0d27a (patch) | |
tree | 0caa0e62b956a2db414a1d1b51c69eb50b8d6467 /activemodel/lib/active_model/test_case.rb | |
parent | e945bcfe4a519e6cf7349443c48fecce2e8c9d67 (diff) | |
download | rails-60756ad4ece2298e85353ed50853f1d260e0d27a.tar.gz rails-60756ad4ece2298e85353ed50853f1d260e0d27a.tar.bz2 rails-60756ad4ece2298e85353ed50853f1d260e0d27a.zip |
Move relevant validation tests from Active Record to Active Model
Diffstat (limited to 'activemodel/lib/active_model/test_case.rb')
-rw-r--r-- | activemodel/lib/active_model/test_case.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/test_case.rb b/activemodel/lib/active_model/test_case.rb index 09fb6d707c..4cb5c9cbc0 100644 --- a/activemodel/lib/active_model/test_case.rb +++ b/activemodel/lib/active_model/test_case.rb @@ -2,6 +2,17 @@ require "active_support/test_case" module ActiveModel #:nodoc: class TestCase < ActiveSupport::TestCase #:nodoc: - include ActiveModel::ValidationsRepairHelper + 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 |