Skip to content

Commit f04e24b

Browse files
committed
Add tests covering "+00:00" and 0 with Time#localtime and Time.at.
See ruby/spec#1285
1 parent d24cbe0 commit f04e24b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spec/ruby/core/time/utc_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@
4343

4444
it "does not treat time with +00:00 offset as UTC" do
4545
Time.new(2022, 1, 1, 0, 0, 0, "+00:00").utc?.should == false
46+
Time.now.localtime("+00:00").utc?.should == false
47+
Time.at(Time.now, in: "+00:00").utc?.should == false
4648
end
4749

4850
it "does not treat time with 0 offset as UTC" do
4951
Time.new(2022, 1, 1, 0, 0, 0, 0).utc?.should == false
52+
Time.now.localtime(0).utc?.should == false
53+
Time.at(Time.now, in: 0).utc?.should == false
5054
end
5155
end
5256

0 commit comments

Comments
 (0)