diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-04 11:19:26 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-04 13:32:04 -0700 |
| commit | cec3b6e2627ea2340e46c2e498f4d41522140094 (patch) | |
| tree | 412a4c4af579e47abfcd21a33c9889854fffd470 /spec/unit/application/string_base_spec.rb | |
| parent | 5a0b547f3289cb8e13b197d021322e03d05bee8e (diff) | |
| download | puppet-cec3b6e2627ea2340e46c2e498f4d41522140094.tar.gz puppet-cec3b6e2627ea2340e46c2e498f4d41522140094.tar.xz puppet-cec3b6e2627ea2340e46c2e498f4d41522140094.zip | |
(#6749) Extract the action from the arguments cleanly.
This adds a test to verify that we are correctly removing the action name from
the set of arguments passed to the string action, then cleans up the previous
code so we don't need to mutilate the command line arguments: we can just
extract it from the resultant set of information.
Reviewed-By: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/unit/application/string_base_spec.rb')
| -rwxr-xr-x | spec/unit/application/string_base_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/application/string_base_spec.rb b/spec/unit/application/string_base_spec.rb index 7f06c05f4..5cfb8352a 100755 --- a/spec/unit/application/string_base_spec.rb +++ b/spec/unit/application/string_base_spec.rb @@ -115,6 +115,14 @@ describe Puppet::Application::StringBase do end end + describe "#setup" do + it "should remove the action name from the arguments" do + app.command_line.stubs(:args).returns %w{--mandatory --bar foo} + app.preinit and app.parse_options and app.setup + app.arguments.should == [{ :mandatory => "--bar" }] + end + end + describe "#main" do before do app.string = Puppet::String[:basetest, '0.0.1'] |
