diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/time/at_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/time/at_spec.rb b/spec/ruby/core/time/at_spec.rb index 6f4d83f9ad..4ff38bbd21 100644 --- a/spec/ruby/core/time/at_spec.rb +++ b/spec/ruby/core/time/at_spec.rb @@ -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 |