Skip to content

Commit 18c47ab

Browse files
committed
Fix Time.new specs and use be_close matcher to tolerate potential 1 second difference
1 parent a894444 commit 18c47ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/ruby/core/time/new_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def zone.local_to_utc(t)
456456
Time.new(2000, 1, 1, in: "+05:00").should == Time.new(2000, 1, 1, 0, 0, 0, "+05:00")
457457
Time.new(2000, 1, in: "+05:00").should == Time.new(2000, 1, 1, 0, 0, 0, "+05:00")
458458
Time.new(2000, in: "+05:00").should == Time.new(2000, 1, 1, 0, 0, 0, "+05:00")
459-
Time.new(in: "+05:00").tap { |time| time.should == time.getlocal("+05:00") }
459+
Time.new(in: "+05:00").should be_close(Time.now.getlocal("+05:00"), TIME_TOLERANCE)
460460
end
461461

462462
it "converts to a provided timezone if all the positional arguments are omitted" do

0 commit comments

Comments
 (0)