aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/whiny_nil_test.rb
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2009-11-24 21:45:14 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2009-11-24 21:45:14 +1100
commit5f2395041d1578433fa825ed5c6f26a201f2203d (patch)
tree3b78531ae77a2173ad0df1103543bdfea0b1f60f /activesupport/test/whiny_nil_test.rb
parent3a72923e27195983d37bdb39ef26b29cf03d3483 (diff)
parente62e6d409986cd5c99234689aa49e3162d7b3a59 (diff)
downloadrails-5f2395041d1578433fa825ed5c6f26a201f2203d.tar.gz
rails-5f2395041d1578433fa825ed5c6f26a201f2203d.tar.bz2
rails-5f2395041d1578433fa825ed5c6f26a201f2203d.zip
Merge branch 'master' of git://github.com/rails/rails into rails_master
Diffstat (limited to 'activesupport/test/whiny_nil_test.rb')
-rw-r--r--activesupport/test/whiny_nil_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/activesupport/test/whiny_nil_test.rb b/activesupport/test/whiny_nil_test.rb
index 4cb22c41b2..009d97940f 100644
--- a/activesupport/test/whiny_nil_test.rb
+++ b/activesupport/test/whiny_nil_test.rb
@@ -13,7 +13,7 @@ class WhinyNilTest < Test::Unit::TestCase
def test_unchanged
nil.method_thats_not_in_whiners
rescue NoMethodError => nme
- assert_match(/nil.method_thats_not_in_whiners/, nme.message)
+ assert(nme.message =~ /nil:NilClass/)
end
def test_active_record
@@ -35,4 +35,16 @@ class WhinyNilTest < Test::Unit::TestCase
rescue RuntimeError => nme
assert(!(nme.message =~ /nil:NilClass/))
end
+
+ def test_no_to_ary_coercion
+ nil.to_ary
+ rescue NoMethodError => nme
+ assert(nme.message =~ /nil:NilClass/)
+ end
+
+ def test_no_to_str_coercion
+ nil.to_str
+ rescue NoMethodError => nme
+ assert(nme.message =~ /nil:NilClass/)
+ end
end