summaryrefslogtreecommitdiffstats
path: root/spec/unit/application
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-04 11:35:46 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-04 13:32:04 -0700
commit0c74495529bd697cdc42986882fc3efb4cdc9903 (patch)
treec0489dfd1b5d0a2cdf516d51f34a87e18c150e94 /spec/unit/application
parentcec3b6e2627ea2340e46c2e498f4d41522140094 (diff)
downloadpuppet-0c74495529bd697cdc42986882fc3efb4cdc9903.tar.gz
puppet-0c74495529bd697cdc42986882fc3efb4cdc9903.tar.xz
puppet-0c74495529bd697cdc42986882fc3efb4cdc9903.zip
(#6749) Handle options with inline arguments.
We didn't correctly handle '--foo=bar' as having supplied an argument during the pre-parse phase. Now we have a test for it, and a fix in the code. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/unit/application')
-rwxr-xr-xspec/unit/application/string_base_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/application/string_base_spec.rb b/spec/unit/application/string_base_spec.rb
index 5cfb8352a..71e67283d 100755
--- a/spec/unit/application/string_base_spec.rb
+++ b/spec/unit/application/string_base_spec.rb
@@ -112,6 +112,12 @@ describe Puppet::Application::StringBase do
app.action.name.should == :foo
app.options.should == { :mandatory => "--bar" }
end
+
+ it "should not skip when --foo=bar is given" do
+ app.command_line.stubs(:args).returns %w{--mandatory=bar --bar foo}
+ expect { app.preinit }.
+ should raise_error ArgumentError, /Unknown option "--bar"/
+ end
end
end