diff --git a/lib/ice_cube/parsers/yaml_parser.rb b/lib/ice_cube/parsers/yaml_parser.rb index a94864de..2e15334d 100644 --- a/lib/ice_cube/parsers/yaml_parser.rb +++ b/lib/ice_cube/parsers/yaml_parser.rb @@ -9,6 +9,7 @@ def initialize(yaml) @hash = YAML::load(yaml) yaml.match(SERIALIZED_START) do |match| start_time = hash[:start_time] || hash[:start_date] + hash = FlexibleHash.new(@hash) TimeUtil.restore_deserialized_offset start_time, match[:tz] end end diff --git a/spec/examples/to_yaml_spec.rb b/spec/examples/to_yaml_spec.rb index 829b64a3..3ff66d39 100644 --- a/spec/examples/to_yaml_spec.rb +++ b/spec/examples/to_yaml_spec.rb @@ -290,7 +290,7 @@ module IceCube symbol_yaml = Schedule.from_hash(symbol_data).to_yaml string_yaml = Schedule.from_hash(string_data).to_yaml - symbol_yaml.should == string_yaml + YAML.load(symbol_yaml).should == YAML.load(string_yaml) end end