Skip to content

Commit 9ff91da

Browse files
committed
Expand Time#at(Rational) specs
1 parent e3c6ea1 commit 9ff91da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/ruby/core/time/at_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@
4040
end
4141

4242
describe "passed Rational" do
43-
it "returns Time with correct nanosecond and microsecond" do
43+
it "returns Time with correct microseconds" do
4444
t = Time.at(Rational(1_486_570_508_539_759, 1_000_000))
4545
t.usec.should == 539_759
4646
t.nsec.should == 539_759_000
4747
end
48+
49+
it "returns Time with correct nanoseconds" do
50+
t = Time.at(Rational(1_486_570_508_539_759_123, 1_000_000_000))
51+
t.usec.should == 539_759
52+
t.nsec.should == 539_759_123
53+
end
4854
end
4955
end
5056

0 commit comments

Comments
 (0)