summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-02 04:07:39 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-02 04:07:39 +0000
commitc921d0e154fe805bd597e1436f264d0d333cfc7e (patch)
tree1e269ea0571960416cbd57b0577ab5f47e78fc91 /test
parent8f610b17d31a1cb80f766fd0211d15153a2bcc46 (diff)
merge revision(s) 39967: [Backport #8194]
* 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/branches/ruby_1_9_3@40054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_time.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 2edba516fe..961c49432c 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -324,6 +324,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