aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2011-03-06 15:23:31 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2011-03-06 15:23:31 +0000
commit5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e (patch)
tree1eca518e7fb90f27e6b9e318a0021f2d820e756f /activesupport/test
parent31f09f9dbc1b8e598fc82d86b622167bfc01d18a (diff)
downloadrails-5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e.tar.gz
rails-5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e.tar.bz2
rails-5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e.zip
Report the correct value of nil.id in the exception message
as different ruby implementations may have different values, for example Rubinius returns 53 for nil.id. [#6444 state:resolved]
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/whiny_nil_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/test/whiny_nil_test.rb b/activesupport/test/whiny_nil_test.rb
index 4b9f06dead..ec3ca99ee6 100644
--- a/activesupport/test/whiny_nil_test.rb
+++ b/activesupport/test/whiny_nil_test.rb
@@ -33,9 +33,11 @@ class WhinyNilTest < Test::Unit::TestCase
end
def test_id
+ nil.stubs(:object_id).returns(999)
nil.id
rescue RuntimeError => nme
assert_no_match(/nil:NilClass/, nme.message)
+ assert_match(/999/, nme.message)
end
def test_no_to_ary_coercion