@@ -78,14 +78,15 @@ module IceCube
7878 end
7979
8080 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 )
8383
84- yaml_string = schedule . to_yaml
84+ yaml_string = schedule1 . to_yaml
8585 schedule2 = Schedule . from_yaml ( yaml_string )
8686
8787 # 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 } )
8990 end
9091
9192 it "should be able to make a round-trip to YAML with .hour_of_day" do
@@ -184,7 +185,7 @@ module IceCube
184185 schedule2 = Schedule . from_yaml ( schedule1 . to_yaml ) # round trip
185186
186187 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 ) )
188189 end
189190
190191 it "should be able to make a round trip with an exception time" do
@@ -323,7 +324,8 @@ module IceCube
323324
324325 symbol_yaml = Schedule . from_hash ( symbol_data ) . to_yaml
325326 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 ] ) )
327329 end
328330
329331 it "should raise an ArgumentError when trying to deserialize an invalid rule type" do
0 commit comments