[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:10:26 UTC 2011


The following commit has been merged in the experimental branch:
commit 76760db5f59ed3ba6b8e3a39f54a3289ccf7c5f4
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Wed Mar 23 17:30:59 2011 -0700

    MAINT: use a table for table-style tests...
    
    We had a series of tests that vary only on one input, and which wanted to
    validate that the same failure happened after every instance; reducing this
    to a set of input data lets us reduce code duplication in the tests.
    
    Reviewed-By: Pieter van de Bruggen <pieter at puppetlabs.com>

diff --git a/spec/unit/string/action_spec.rb b/spec/unit/string/action_spec.rb
index 4026c9a..caf3291 100755
--- a/spec/unit/string/action_spec.rb
+++ b/spec/unit/string/action_spec.rb
@@ -5,20 +5,11 @@ require 'puppet/string/action'
 
 describe Puppet::String::Action do
   describe "when validating the action name" do
-    it "should require a name" do
-      lambda { Puppet::String::Action.new(nil,nil) }.should raise_error("'' is an invalid action name")
-    end
-
-    it "should not allow empty names" do
-      lambda { Puppet::String::Action.new(nil,'') }.should raise_error("'' is an invalid action name")
-    end
-
-    it "should not allow names with whitespace" do
-      lambda { Puppet::String::Action.new(nil,'foo bar') }.should raise_error("'foo bar' is an invalid action name")
-    end
-
-    it "should not allow names beginning with dashes" do
-      lambda { Puppet::String::Action.new(nil,'-foobar') }.should raise_error("'-foobar' is an invalid action name")
+    [nil, '', 'foo bar', '-foobar'].each do |input|
+      it "should treat #{input.inspect} as an invalid name" do
+        expect { Puppet::Interface::Action.new(nil, input) }.
+          should raise_error(/is an invalid action name/)
+      end
     end
   end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list