From 60756ad4ece2298e85353ed50853f1d260e0d27a Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 20 Mar 2009 15:07:49 +0000 Subject: Move relevant validation tests from Active Record to Active Model --- activemodel/lib/active_model/test_case.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'activemodel/lib/active_model') 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 -- cgit v1.2.3