summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMehrez Alachheb <lachheb.mehrez@gmail.com>2014-06-12 10:53:20 +0200
committerMehrez Alachheb <lachheb.mehrez@gmail.com>2014-06-12 10:53:20 +0200
commit0c00fdb5775cd2e5cd0d6d70ec73fc2133b72956 (patch)
tree1dd8a88898792be245a43f2cef1ba9a25281803c /spec
parent0c6ce30635400bee50ee205990031ae39edaa3dc (diff)
downloadmixlib-cli-0c00fdb5775cd2e5cd0d6d70ec73fc2133b72956.tar.gz
Fix code review notes
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/cli_spec.rb10
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