diff options
author | Mehrez Alachheb <lachheb.mehrez@gmail.com> | 2014-06-12 10:53:20 +0200 |
---|---|---|
committer | Mehrez Alachheb <lachheb.mehrez@gmail.com> | 2014-06-12 10:53:20 +0200 |
commit | 0c00fdb5775cd2e5cd0d6d70ec73fc2133b72956 (patch) | |
tree | 1dd8a88898792be245a43f2cef1ba9a25281803c /spec | |
parent | 0c6ce30635400bee50ee205990031ae39edaa3dc (diff) | |
download | mixlib-cli-0c00fdb5775cd2e5cd0d6d70ec73fc2133b72956.tar.gz |
Fix code review notes
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/cli_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/mixlib/cli_spec.rb b/spec/mixlib/cli_spec.rb index e2fa647..550b26f 100644 --- a/spec/mixlib/cli_spec.rb +++ b/spec/mixlib/cli_spec.rb @@ -175,26 +175,26 @@ describe Mixlib::CLI do @cli = TestCLI.new lambda { @cli.parse_options([]) }.should raise_error(SystemExit) end - + it "should exit if option is not included in the list" do TestCLI.option(:inclusion, :short => "-i val", :in => ['one', 'two']) @cli = TestCLI.new lambda { @cli.parse_options(['-i', 'three']) }.should raise_error(SystemExit) end - - it "should exit if options key :in is not an array" do + + it "should raise ArgumentError if options key :in is not an array" do TestCLI.option(:inclusion, :short => "-i val", :in => 'foo') @cli = TestCLI.new lambda { @cli.parse_options(['-i', 'three']) }.should raise_error(ArgumentError) end - + it "should not exit if option is included in the list" do TestCLI.option(:inclusion, :short => "-i val", :in => ['one', 'two']) @cli = TestCLI.new @cli.parse_options(['-i', 'one']) @cli.config[:inclusion].should == 'one' end - + it "should change description if :in key is specified" do TestCLI.option(:inclusion, :short => "-i val", :in => ['one', 'two'], :description => 'desc') @cli = TestCLI.new |