summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStephen Delano <stephen@opscode-stephen.local>2010-03-26 13:52:27 -0700
committerStephen Delano <stephen@opscode-stephen.local>2010-03-26 13:52:27 -0700
commitaea4132a9e5253fb78877e1c757da704216459fa (patch)
tree395421afd0ee6ad886e8bc8c8d2e70ac3e2904a4 /spec
parent7def4b217351212782f9214dac9dd2f1a8de78af (diff)
downloadmixlib-cli-aea4132a9e5253fb78877e1c757da704216459fa.tar.gz
adding test for parse_options return behavior
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/cli_spec.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/mixlib/cli_spec.rb b/spec/mixlib/cli_spec.rb
index 6b9d9e6..05c6491 100644
--- a/spec/mixlib/cli_spec.rb
+++ b/spec/mixlib/cli_spec.rb
@@ -167,9 +167,7 @@ describe Mixlib::CLI do
@cli = TestCLI.new
lambda { @cli.parse_options([]) }.should raise_error(SystemExit)
end
- end
-
- describe "after_parse_options" do
+
it "should preserve all of the commandline arguments, ARGV" do
TestCLI.option(:config_file, :short => "-c CONFIG")
@cli = TestCLI.new
@@ -179,6 +177,12 @@ describe Mixlib::CLI do
ARGV.should == ['-c','foo.rb']
ARGV.replace argv_old
end
+
+ it "should return any un-parsed elements" do
+ TestCLI.option(:party, :short => "-p LOCATION")
+ @cli = TestCLI.new
+ @cli.parse_options([ '-p', 'opscode', 'hard' ]).should == ['hard']
+ end
end
end