summaryrefslogtreecommitdiffstats
path: root/spec/unit/application
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-02-24 08:34:24 -0800
committerLuke Kanies <luke@puppetlabs.com>2011-02-24 08:34:24 -0800
commit21b541d6ca4b1b76a4e0cd525fa66192c0857a5e (patch)
tree09f30aea45f73f3bd11a59e38eefd76900266416 /spec/unit/application
parent59a648502a8f09948bd2d25a72a9099f7740e108 (diff)
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 <luke@puppetlabs.com>
Diffstat (limited to 'spec/unit/application')
-rw-r--r--spec/unit/application/interface_base_spec.rb12
1 files changed, 12 insertions, 0 deletions
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