diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-25 13:06:11 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-25 13:06:11 -0800 |
commit | 8f6da9483b28ec82e4577bf4cbe5209e2c750c84 (patch) | |
tree | 4c52a09b3268ff90dae12f8bc525f0b2f3acbace /activesupport/test | |
parent | 2e79ec71a542c2d2e7bedbe12eda0b5e177fb0e0 (diff) | |
parent | 9f1c359a201bfacff7b89cd1e8579bc1bdf541e2 (diff) | |
download | rails-8f6da9483b28ec82e4577bf4cbe5209e2c750c84.tar.gz rails-8f6da9483b28ec82e4577bf4cbe5209e2c750c84.tar.bz2 rails-8f6da9483b28ec82e4577bf4cbe5209e2c750c84.zip |
Merge remote branch 'jose/am'
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/whiny_nil_test.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/activesupport/test/whiny_nil_test.rb b/activesupport/test/whiny_nil_test.rb index 009d97940f..1e4f8d854a 100644 --- a/activesupport/test/whiny_nil_test.rb +++ b/activesupport/test/whiny_nil_test.rb @@ -13,38 +13,39 @@ class WhinyNilTest < Test::Unit::TestCase def test_unchanged nil.method_thats_not_in_whiners rescue NoMethodError => nme - assert(nme.message =~ /nil:NilClass/) + assert_match(/nil:NilClass/, nme.message) end def test_active_record nil.save! rescue NoMethodError => nme - assert(!(nme.message =~ /nil:NilClass/)) + assert_no_match(/nil:NilClass/, nme.message) assert_match(/nil\.save!/, nme.message) end def test_array nil.each rescue NoMethodError => nme - assert(!(nme.message =~ /nil:NilClass/)) + assert_no_match(/nil:NilClass/, nme.message) assert_match(/nil\.each/, nme.message) end def test_id nil.id rescue RuntimeError => nme - assert(!(nme.message =~ /nil:NilClass/)) + assert_no_match(/nil:NilClass/, nme.message) end def test_no_to_ary_coercion nil.to_ary rescue NoMethodError => nme - assert(nme.message =~ /nil:NilClass/) + assert_no_match(/nil:NilClass/, nme.message) + assert_match(/nil\.to_ary/, nme.message) end def test_no_to_str_coercion nil.to_str rescue NoMethodError => nme - assert(nme.message =~ /nil:NilClass/) + assert_match(/nil:NilClass/, nme.message) end end |