ruby-changes:46999
From: eregon <ko1@a...>
Date: Mon, 19 Jun 2017 22:00:21 +0900 (JST)
Subject: [ruby-changes:46999] eregon:r59113 (trunk): Adapt Time#zone spec to deal with differences of TZ validation on Windows
eregon 2017-06-19 22:00:12 +0900 (Mon, 19 Jun 2017) New Revision: 59113 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59113 Log: Adapt Time#zone spec to deal with differences of TZ validation on Windows * [Bug #13591] [ruby-core:81347] Modified files: trunk/spec/rubyspec/core/time/zone_spec.rb Index: spec/rubyspec/core/time/zone_spec.rb =================================================================== --- spec/rubyspec/core/time/zone_spec.rb (revision 59112) +++ spec/rubyspec/core/time/zone_spec.rb (revision 59113) @@ -62,7 +62,7 @@ describe "Time#zone" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/time/zone_spec.rb#L62 Time.now.utc.zone.should == "UTC" end - platform_is_not :aix do + platform_is_not :aix, :windows do it "defaults to UTC when bad zones given" do with_timezone("hello-foo") do Time.now.utc_offset.should == 0 @@ -74,5 +74,17 @@ describe "Time#zone" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/time/zone_spec.rb#L74 Time.now.utc_offset.should == 0 end end + end + + platform_is :windows do + # See https://bugs.ruby-lang.org/issues/13591#note-11 + it "defaults to UTC when bad zones given" do + with_timezone("1,2") do + Time.now.utc_offset.should == 0 + end + with_timezone("12") do + Time.now.utc_offset.should == 0 + end + end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/