diff options
-rwxr-xr-x | spec/unit/application/string_base_spec.rb | 30 | ||||
-rwxr-xr-x | spec/unit/string/indirector_spec.rb | 8 |
2 files changed, 23 insertions, 15 deletions
diff --git a/spec/unit/application/string_base_spec.rb b/spec/unit/application/string_base_spec.rb index 37f6fddcb..20185b526 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 29e8e7086..cb85eaa05 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 |