[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:17:33 UTC 2011
The following commit has been merged in the experimental branch:
commit 7db4793eac52cbbf9c5919597e8e3a6b0a7bbd38
Author: Daniel Pittman <daniel at puppetlabs.com>
Date: Wed Apr 20 19:04:50 2011 -0700
maint: clean up testing code a fraction...
This rewrites a block of identical tests down to a little table, then applies
the test over that.
diff --git a/spec/unit/interface/face_collection_spec.rb b/spec/unit/interface/face_collection_spec.rb
index f9498cb..c3e4343 100755
--- a/spec/unit/interface/face_collection_spec.rb
+++ b/spec/unit/interface/face_collection_spec.rb
@@ -25,28 +25,16 @@ describe Puppet::Interface::FaceCollection do
end
describe "::validate_version" do
- it 'should permit three number versions' do
- subject.validate_version('10.10.10').should == true
- end
-
- it 'should permit versions with appended descriptions' do
- subject.validate_version('10.10.10beta').should == true
- end
-
- it 'should not permit versions with more than three numbers' do
- subject.validate_version('1.2.3.4').should == false
- end
-
- it 'should not permit versions with only two numbers' do
- subject.validate_version('10.10').should == false
- end
-
- it 'should not permit versions with only one number' do
- subject.validate_version('123').should == false
- end
-
- it 'should not permit versions with text in any position but at the end' do
- subject.validate_version('v1.1.1').should == false
+ { '10.10.10' => true,
+ '1.2.3.4' => false,
+ '10.10.10beta' => true,
+ '10.10' => false,
+ '123' => false,
+ 'v1.1.1' => false,
+ }.each do |input, result|
+ it "should#{result ? '' : ' not'} permit #{input.inspect}" do
+ subject.validate_version(input).should(result ? be_true : be_false)
+ end
end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list