From d38e52224f19b4fcedef722b2aab8fc94a59b481 Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Thu, 22 Jul 2010 14:33:58 -0700 Subject: [#4333] old optparse doesn't support default_argv= optparse hasn't always had the concept of default_argv. Fortunately, we don't really need it. --- spec/unit/application_spec.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'spec') diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index 3c354cce9..433809172 100755 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -194,7 +194,6 @@ describe Puppet::Application do it "should create a new option parser when needed" do option_parser = stub "option parser" option_parser.stubs(:on) - option_parser.stubs(:default_argv=) OptionParser.expects(:new).returns(option_parser).once @app.option_parser.should == option_parser @app.option_parser.should == option_parser @@ -203,7 +202,6 @@ describe Puppet::Application do it "should pass the banner to the option parser" do option_parser = stub "option parser" option_parser.stubs(:on) - option_parser.stubs(:default_argv=) @app.class.instance_eval do banner "banner" end @@ -213,15 +211,6 @@ describe Puppet::Application do @app.option_parser end - it "should set the optionparser's args to the command line args" do - option_parser = stub "option parser" - option_parser.stubs(:on) - option_parser.expects(:default_argv=).with(%w{ fake args }) - @app.command_line.stubs(:args).returns(%w{ fake args }) - OptionParser.expects(:new).returns(option_parser) - @app.option_parser - end - it "should get options from Puppet.settings.optparse_addargs" do Puppet.settings.expects(:optparse_addargs).returns([]) @@ -237,7 +226,8 @@ describe Puppet::Application do end it "should ask OptionParser to parse the command-line argument" do - @app.option_parser.expects(:parse!) + @app.command_line.stubs(:args).returns(%w{ fake args }) + @app.option_parser.expects(:parse!).with(%w{ fake args }) @app.parse_options end -- cgit