diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-29 22:00:58 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-29 22:00:58 +0000 |
commit | c34e9f23aa2b6909e92623710e91cd99eaff2dc3 (patch) | |
tree | 5c7a3f0dc46c41f15e82c52a15db57710182ef5d /test/ruby/test_object.rb | |
parent | 115a51f8ec4972d6a1b4000b50536b1a64a1888e (diff) | |
download | ruby-c34e9f23aa2b6909e92623710e91cd99eaff2dc3.tar.gz |
* object.c: Improve error for failed implicit conversions [Bug #7539]
* error.c: Adapt rdoc
* test/ruby/test_object.rb: Test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r-- | test/ruby/test_object.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 9f0e9bc5b2..9787525bce 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -885,4 +885,12 @@ class TestObject < Test::Unit::TestCase assert_not_initialize_copy {st.new} assert_not_initialize_copy {Time.now} end + + def test_type_error_message + issue = "Bug #7539" + err = assert_raise(TypeError){ Integer([42]) } + assert_equal "can't convert Array into Integer", err.message, issue + err = assert_raise(TypeError){ [].first([42]) } + assert_equal 'no implicit conversion of Array into Integer', err.message, issue + end end |