@@ -78,14 +78,15 @@ module IceCube
78
78
end
79
79
80
80
it "should be able to make a round-trip to YAML with .day_of_year" do
81
- schedule = Schedule . new ( Time . now )
82
- schedule . add_recurrence_rule Rule . yearly . day_of_year ( 100 , 200 )
81
+ schedule1 = Schedule . new ( Time . now )
82
+ schedule1 . add_recurrence_rule Rule . yearly . day_of_year ( 100 , 200 )
83
83
84
- yaml_string = schedule . to_yaml
84
+ yaml_string = schedule1 . to_yaml
85
85
schedule2 = Schedule . from_yaml ( yaml_string )
86
86
87
87
# compare without usecs
88
- expect ( schedule . first ( 10 ) . map { |r | r . to_s } ) . to eq ( schedule2 . first ( 10 ) . map { |r | r . to_s } )
88
+ expect ( schedule2 . first ( 10 ) . map { |r | r . to_s } )
89
+ . to eq ( schedule1 . first ( 10 ) . map { |r | r . to_s } )
89
90
end
90
91
91
92
it "should be able to make a round-trip to YAML with .hour_of_day" do
@@ -184,7 +185,7 @@ module IceCube
184
185
schedule2 = Schedule . from_yaml ( schedule1 . to_yaml ) # round trip
185
186
186
187
end_time = Time . now + ONE_DAY
187
- expect ( schedule1 . occurrences ( end_time ) ) . to eq ( schedule2 . occurrences ( end_time ) )
188
+ expect ( schedule2 . occurrences ( end_time ) ) . to eq ( schedule1 . occurrences ( end_time ) )
188
189
end
189
190
190
191
it "should be able to make a round trip with an exception time" do
@@ -323,7 +324,8 @@ module IceCube
323
324
324
325
symbol_yaml = Schedule . from_hash ( symbol_data ) . to_yaml
325
326
string_yaml = Schedule . from_hash ( string_data ) . to_yaml
326
- expect ( YAML . load ( symbol_yaml ) ) . to eq ( YAML . load ( string_yaml ) )
327
+ expect ( YAML . safe_load ( symbol_yaml , permitted_classes : [ Symbol , Time ] ) )
328
+ . to eq ( YAML . safe_load ( string_yaml , permitted_classes : [ Symbol , Time ] ) )
327
329
end
328
330
329
331
it "should raise an ArgumentError when trying to deserialize an invalid rule type" do
0 commit comments