Skip to content

Commit

Permalink
Add specs for cases where timezone used was changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmfdias authored and eregon committed Jun 4, 2015
1 parent 7bc8c1b commit fb2bf67
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions core/time/shared/local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@
[0, 0, 0, 1, 1, 1910, 6, 1, false, "AMT"]
end
end

describe "timezone changes" do
it "correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'" do
with_timezone("Europe/Istanbul") do
Time.send(@method, 1910, 10, 1).to_a.should ==
[4, 3, 0, 1, 10, 1910, 6, 274, false, "EET"]
end
end

it "correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'" do
with_timezone("Europe/Lisbon") do
Time.send(@method, 1912, 1, 1).to_a.should ==
[45, 36, 0, 1, 1, 1912, 1, 1, false, "WET"]
end
end

it "correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'" do
with_timezone("Europe/Amsterdam") do
Time.send(@method, 1940, 5, 16).to_a.should ==
[0, 40, 1, 16, 5, 1940, 4, 137, true, "CEST"]
end
end
end
end

describe :time_local_10_arg, :shared => true do
Expand Down

0 comments on commit fb2bf67

Please sign in to comment.