diff options
Diffstat (limited to 'activesupport/test/whiny_nil_test.rb')
-rw-r--r-- | activesupport/test/whiny_nil_test.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/activesupport/test/whiny_nil_test.rb b/activesupport/test/whiny_nil_test.rb index 9ed31bfef5..4483134be1 100644 --- a/activesupport/test/whiny_nil_test.rb +++ b/activesupport/test/whiny_nil_test.rb @@ -1,6 +1,4 @@ -require 'test/unit' - -# mock to enable testing without activerecord +# Stub to enable testing without Active Record module ActiveRecord class Base def save! @@ -8,8 +6,8 @@ module ActiveRecord end end -require File.dirname(__FILE__) + '/../lib/active_support/inflector' -require File.dirname(__FILE__) + '/../lib/active_support/whiny_nil' +require File.dirname(__FILE__) + '/abstract_unit' +require 'active_support/whiny_nil' class WhinyNilTest < Test::Unit::TestCase def test_unchanged @@ -17,14 +15,14 @@ class WhinyNilTest < Test::Unit::TestCase rescue NoMethodError => nme assert_match(/nil.method_thats_not_in_whiners/, nme.message) end - + def test_active_record nil.save! rescue NoMethodError => nme assert(!(nme.message =~ /nil:NilClass/)) assert_match(/nil\.save!/, nme.message) end - + def test_array nil.each rescue NoMethodError => nme |