[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:13:07 UTC 2011


The following commit has been merged in the experimental branch:
commit 6fcf03c52f98c6e4bcce85548d783a832eaa387b
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Sun Apr 10 16:47:33 2011 -0700

    maint: added testing for Puppet::Faces#[]
    
    We didn't do much testing here, which was vaguely reasonable when we didn't
    distinguish it from the #define method.  Now they are split out we need to be
    more careful about testing the right things.
    
    Reviewed-By: Matt Robinson <matt at puppetlabs.com>

diff --git a/spec/unit/interface_spec.rb b/spec/unit/interface_spec.rb
index ea11b21..b25d06f 100755
--- a/spec/unit/interface_spec.rb
+++ b/spec/unit/interface_spec.rb
@@ -1,3 +1,4 @@
+require 'spec_helper'
 require 'puppet/faces'
 require 'puppet/interface'
 
@@ -16,6 +17,20 @@ describe Puppet::Interface do
     Puppet::Interface::FaceCollection.instance_variable_set("@faces", @faces)
   end
 
+  describe "#[]" do
+    it "should fail when no version is requested" do
+      expect { subject[:huzzah] }.should raise_error ArgumentError
+    end
+
+    it "should raise an exception when the requested version is unavailable" do
+      expect { subject[:huzzah, '17.0.0'] }.should raise_error, Puppet::Error
+    end
+
+    it "should raise an exception when the requested face doesn't exist" do
+      expect { subject[:burrble_toot, :current] }.should raise_error, Puppet::Error
+    end
+  end
+
   describe "#define" do
     it "should register the face" do
       face = subject.define(:face_test_register, '0.0.1')

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list