diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-27 11:37:59 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-27 11:37:59 +0000 |
commit | c64f26a28171e3e9400f027e63d02dc5af5f8ca5 (patch) | |
tree | 8152ceb167dc4162839874aab7446eb40d251574 /test/ruby | |
parent | 2f1e7f6a71a1eaaa753c3ed2e897fd4d4771f2ea (diff) | |
download | ruby-c64f26a28171e3e9400f027e63d02dc5af5f8ca5.tar.gz |
* time.c (num_exact): use to_r method only if to_int method is
available.
[ruby-core:53764] [Bug #8173] reported by Hiro Asari.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 15b6ae5bef..22df27067f 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -351,6 +351,7 @@ class TestTime < Test::Unit::TestCase end assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -(2**31), :foo, :foo) } o = Object.new + def o.to_int; 0; end def o.to_r; nil; end assert_raise(TypeError) { Time.gm(2000, 1, 1, 0, 0, o, :foo, :foo) } def o.to_r; ""; end |