aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-25 21:59:00 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-25 22:00:36 +0100
commit9f1c359a201bfacff7b89cd1e8579bc1bdf541e2 (patch)
treef7e538760c2444a582ef6d4a38949acd42111b29 /activesupport/test
parent88ba056043e22c4c60dde6b07df897e502f49491 (diff)
downloadrails-9f1c359a201bfacff7b89cd1e8579bc1bdf541e2.tar.gz
rails-9f1c359a201bfacff7b89cd1e8579bc1bdf541e2.tar.bz2
rails-9f1c359a201bfacff7b89cd1e8579bc1bdf541e2.zip
Fix whiny_nil tests, improve error messages and make CI happy.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/whiny_nil_test.rb13
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