From 21b541d6ca4b1b76a4e0cd525fa66192c0857a5e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 24 Feb 2011 08:34:24 -0800 Subject: Fixing plugin usage I had broken some usages of plugins by incorrectly selecting command-line arguments. The fix was to remove the #main method contained in the IndirectionBase subclass. Signed-off-by: Luke Kanies --- spec/unit/application/interface_base_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/unit/application/interface_base_spec.rb') diff --git a/spec/unit/application/interface_base_spec.rb b/spec/unit/application/interface_base_spec.rb index 4ef3869c2..1717f4982 100644 --- a/spec/unit/application/interface_base_spec.rb +++ b/spec/unit/application/interface_base_spec.rb @@ -14,6 +14,7 @@ describe Puppet::Application::InterfaceBase do @app.stubs(:interface).returns base_interface @app.stubs(:exit) @app.stubs(:puts) + Puppet::Util::Log.stubs(:newdestination) end describe "when calling main" do @@ -40,6 +41,17 @@ describe Puppet::Application::InterfaceBase do @app.stubs(:validate) end + it "should set the verb from the command line arguments" do + @app.setup + @app.verb.should == "find" + end + + it "should make sure arguments are an array" do + @app.command_line.stubs(:args).returns(["find", "myname"]) + @app.setup + @app.arguments.should == ["myname"] + end + it "should set the options on the interface" do @app.options[:foo] = "bar" @app.setup -- cgit