mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
States Time.at expects rational-like argument to respond to #to_int
https://bugs.ruby-lang.org/issues/17131
This commit is contained in:
parent
75c4e9b72e
commit
7e1fddba4a
1 changed files with 6 additions and 0 deletions
|
@ -92,6 +92,12 @@ describe "Time.at" do
|
|||
o.should_receive(:to_r).and_return(Rational(5, 2))
|
||||
Time.at(o).should == Time.at(Rational(5, 2))
|
||||
end
|
||||
|
||||
it "needs for the argument to respond to #to_int too" do
|
||||
o = mock('rational-but-no-to_int')
|
||||
o.should_receive(:to_r).and_return(Rational(5, 2))
|
||||
-> { Time.at(o) }.should raise_error(TypeError)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue