summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authordreamcat4 <dreamcat4@gmail.com>2010-03-05 22:10:36 +0000
committerdreamcat4 <dreamcat4@gmail.com>2010-03-05 22:10:36 +0000
commit5e317d8b0aeca0c8718c4c80c7afeb27d7f339f8 (patch)
treecd811f69afe4229125ffdd6141cf93aaec07876d /spec
parentce2b82563c1e25425f78f81a500cdd8dec03759c (diff)
downloadmixlib-cli-5e317d8b0aeca0c8718c4c80c7afeb27d7f339f8.tar.gz
[CHEF-828] Tests
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/cli_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/mixlib/cli_spec.rb b/spec/mixlib/cli_spec.rb
index a5fec6c..6b9d9e6 100644
--- a/spec/mixlib/cli_spec.rb
+++ b/spec/mixlib/cli_spec.rb
@@ -167,7 +167,18 @@ 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
+ argv_old = ARGV.dup
+ ARGV.replace ['-c','foo.rb']
+ @cli.parse_options()
+ ARGV.should == ['-c','foo.rb']
+ ARGV.replace argv_old
+ end
end
end