summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-07-22 14:33:58 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-25 22:24:45 -0700
commitd38e52224f19b4fcedef722b2aab8fc94a59b481 (patch)
tree18cff77c9667e3e951090489cfe493d596677b25 /spec
parent86b0882c8a772b2e84e8da0609ec911d085ac0fc (diff)
downloadpuppet-d38e52224f19b4fcedef722b2aab8fc94a59b481.tar.gz
puppet-d38e52224f19b4fcedef722b2aab8fc94a59b481.tar.xz
puppet-d38e52224f19b4fcedef722b2aab8fc94a59b481.zip
[#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.
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/application_spec.rb14
1 files changed, 2 insertions, 12 deletions
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