[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:49 UTC 2011
The following commit has been merged in the experimental branch:
commit 37c97cdca07fd8c446e924547239c8f09eda8810
Author: Daniel Pittman <daniel at puppetlabs.com>
Date: Fri Apr 1 12:47:32 2011 -0700
(#6749) clean up various testing bits...
This cleans up a whole bunch of bits of the testing code around the place;
nothing revolutionary, just nicer and more robust code.
Reviewed-By: Pieter van de Bruggen <pieter at puppetlabs.com>
diff --git a/spec/unit/application/string_base_spec.rb b/spec/unit/application/string_base_spec.rb
index 37f6fdd..20185b5 100755
--- a/spec/unit/application/string_base_spec.rb
+++ b/spec/unit/application/string_base_spec.rb
@@ -38,24 +38,32 @@ describe Puppet::Application::StringBase do
app.command_line.stubs(:args).returns %w{}
end
- it "should set the string based on the type"
- it "should set the format based on the string default"
-
describe "parsing the command line" do
before :all do
Puppet::String[:basetest, '0.0.1'].action :foo do
option "--foo"
- invoke do |options|
- options
- end
+ invoke { |options| options }
end
end
- it "should find the action" do
- app.command_line.stubs(:args).returns %w{foo}
- app.preinit
- app.action.should be
- app.action.name.should == :foo
+ context "with just an action" do
+ before :all do
+ app.command_line.stubs(:args).returns %w{foo}
+ app.preinit
+ end
+
+ it "should set the string based on the type" do
+ app.string.name.should == :basetest
+ end
+
+ it "should set the format based on the string default" do
+ app.format.should == :pson
+ end
+
+ it "should find the action" do
+ app.action.should be
+ app.action.name.should == :foo
+ end
end
it "should fail if no action is given" do
diff --git a/spec/unit/string/indirector_spec.rb b/spec/unit/string/indirector_spec.rb
index 29e8e70..cb85eaa 100755
--- a/spec/unit/string/indirector_spec.rb
+++ b/spec/unit/string/indirector_spec.rb
@@ -41,13 +41,13 @@ describe Puppet::String::Indirector do
end
it "should be able to override its indirection name" do
- @instance.set_indirection_name :foo
- @instance.indirection_name.should == :foo
+ subject.set_indirection_name :foo
+ subject.indirection_name.should == :foo
end
it "should be able to set its terminus class" do
- @instance.indirection.expects(:terminus_class=).with(:myterm)
- @instance.set_terminus(:myterm)
+ subject.indirection.expects(:terminus_class=).with(:myterm)
+ subject.set_terminus(:myterm)
end
it "should define a class-level 'info' action" do
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list