Daniel pointed out that I caught one hash-order time bomb and "fixed it with
extreme prejudice" but missed another.  This change would address both with
a kinder touch:

diff --git a/spec/unit/util/zaml_spec.rb b/spec/unit/util/zaml_spec.rb
index 782ebdb..920e90e 100755
--- a/spec/unit/util/zaml_spec.rb
+++ b/spec/unit/util/zaml_spec.rb
@@ -36,6 +36,10 @@ describe "Pure ruby yaml implementation" do
     end
   }

+  def set_of_lines(l)
+    l.split("\n").sort
+  end
+
   it "should handle references to Array in Hash values correctly" do
     list = [1]
     data = { "one" => list, "two" => list }
@@ -46,13 +50,14 @@ describe "Pure ruby yaml implementation" do
   it "should handle references to Hash in Hash values correctly" do
     hash = { 1 => 1 }
     data = { "one" => hash, "two" => hash }
-    data.to_yaml.should == "--- \n  two: &id001 \n    1: 1\n  one: *id001"
+    set_of_lines(data.to_yaml).should == set_of_lines("--- \n  two: &id001
\n    1: 1\n  one: *id001")
     expect { YAML.load(data.to_yaml).should == data }.should_not
raise_error
   end

   it "should handle references to Scalar in Hash" do
     str = "hello"
     data = { "one" => str, "two" => str }
+    set_of_lines(data.to_yaml).should == set_of_lines("--- \n  two:
hello\n  one: hello")
     expect { YAML.load(data.to_yaml).should == data }.should_not
raise_error
   end




-- M
-----------------------------------------------------------
When in trouble or in doubt, run in circles,
scream and shout. -- 1920's parody of the
maritime general prudential rule
------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to