Closed espen closed 9 years ago
:confounded: oh timezones.
I can't reproduce the issue on my computer. I've tried by running the specs with various timezones as my system default. I'm using ruby 2.1.4p265.
Can you provide any further steps to making these fail? Does the following change to the spec fix the failure on your computer?
diff --git a/spec/lib/time_util_spec.rb b/spec/lib/time_util_spec.rb
index 55da142..e1709f0 100644
--- a/spec/lib/time_util_spec.rb
+++ b/spec/lib/time_util_spec.rb
@@ -81,8 +81,8 @@ describe TimeUtil do
it "handles daylight savings" do
# FYI, clocks turn forward an hour on Nov 2 at 9:00:00 UTC
- minute_before_clocks_change = Time.parse("Nov 2 at 08:59:00 UTC") # on west coast
- minute_after_clocks_change = Time.parse("Nov 2 at 09:01:00 UTC") # on west coast
+ minute_before_clocks_change = Time.parse("Nov 2 2014 at 08:59:00 UTC") # on west coast
+ minute_after_clocks_change = Time.parse("Nov 2 2014 at 09:01:00 UTC") # on west coast
expect(TimeUtil.timezone_offset("America/Los_Angeles", moment: minute_before_clocks_change)).to eq("-07:00")
expect(TimeUtil.timezone_offset("America/Los_Angeles", moment: minute_after_clocks_change)).to eq("-08:00")
I'm on CEST using Ruby 2.2.2. Switching to 1.9.3 or 2.1.6 turns tests green.
I recall this from earlier, perhaps it's related to the failing tests: https://byparker.com/blog/2014/ruby-2-2-0-time-parse-localtime-regression/
Failures:
1) Icalendar::Recurrence::TimeUtil timezone_offset handles daylight savings Failure/Error: expect(TimeUtil.timezone_offset("America/Los_Angeles", moment: minute_after_clocks_change)).to eq("-08:00")