Skip to content

Commit 4bf1718

Browse files
committed
Fix some YAML round trip test failures
Closes #483
1 parent 66f1d79 commit 4bf1718

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spec/examples/to_yaml_spec.rb

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
module IceCube
44
describe Schedule, 'to_yaml' do
55

6-
before(:all) do
6+
before do
77
require 'active_support/time'
88
Time.zone = 'Eastern Time (US & Canada)'
99
end
1010

1111
[:yearly, :monthly, :weekly, :daily, :hourly, :minutely, :secondly].each do |type|
1212
it "should make a #{type} round trip with to_yaml [#47]" do
13-
schedule = Schedule.new(Time.now)
13+
schedule = Schedule.new(Time.zone.now)
1414
schedule.add_recurrence_rule Rule.send(type, 3)
1515
expect(Schedule.from_yaml(schedule.to_yaml).first(3).inspect).to eq(schedule.first(3).inspect)
1616
end
@@ -57,7 +57,7 @@ module IceCube
5757
end
5858

5959
it 'should be able to make a round-trip to YAML with .day_of_month' do
60-
schedule = Schedule.new(Time.now)
60+
schedule = Schedule.new(Time.zone.now)
6161
schedule.add_recurrence_rule Rule.monthly.day_of_month(10, 20)
6262

6363
yaml_string = schedule.to_yaml
@@ -68,7 +68,7 @@ module IceCube
6868
end
6969

7070
it 'should be able to make a round-trip to YAML with .day_of_week' do
71-
schedule = Schedule.new(Time.now)
71+
schedule = Schedule.new(Time.zone.now)
7272
schedule.add_recurrence_rule Rule.weekly.day_of_week(:monday => [1, -2])
7373

7474
yaml_string = schedule.to_yaml
@@ -324,6 +324,5 @@ module IceCube
324324
data = {:validations => {:fake => []}, :rule_type => 'IceCube::DailyRule', :interval => 1}
325325
expect { Rule.from_hash(data) }.to raise_error(ArgumentError, 'Invalid rule validation type: fake')
326326
end
327-
328327
end
329328
end

0 commit comments

Comments
 (0)