diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-18 13:41:44 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-18 13:41:44 +0000 |
commit | 67f93ddc216c56298aeb9981fc36649987438457 (patch) | |
tree | ceacba47fb0d461ee9846a40f194c2a87544bbb3 /test/ruby | |
parent | 430eb945ceeec646f30ee79302d2f265b25bc1ee (diff) | |
download | ruby-67f93ddc216c56298aeb9981fc36649987438457.tar.gz |
* rational.c (nurat_s_convert): calls to_r when the given argument
is non-integer.
* rational.c (nurat_s_convert): raises TypeError when the given
argument is nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_complex.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 39a02044fa..846fcf9a3e 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -126,8 +126,8 @@ class Complex_Test < Test::Unit::TestCase if @rational && !@keiju assert_equal(Complex(1,1),Complex('3/3','3/3')) end - assert_raise(ArgumentError){Complex(nil)} - assert_raise(ArgumentError){Complex(Object.new)} + assert_raise(TypeError){Complex(nil)} + assert_raise(TypeError){Complex(Object.new)} assert_raise(ArgumentError){Complex()} assert_raise(ArgumentError){Complex(1,2,3)} diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index 8cacab9a09..b43db9c982 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -124,9 +124,9 @@ class Rational_Test < Test::Unit::TestCase assert_equal(Rational(3),Rational('3')) assert_equal(Rational(1),Rational('3.0','3.0')) assert_equal(Rational(1),Rational('3/3','3/3')) - assert_raise(ArgumentError){Rational(nil)} + assert_raise(TypeError){Rational(nil)} assert_raise(ArgumentError){Rational('')} - assert_raise(ArgumentError){Rational(Object.new)} + assert_raise(TypeError){Rational(Object.new)} assert_raise(ArgumentError){Rational()} assert_raise(ArgumentError){Rational(1,2,3)} |