From 0c00fdb5775cd2e5cd0d6d70ec73fc2133b72956 Mon Sep 17 00:00:00 2001 From: Mehrez Alachheb Date: Thu, 12 Jun 2014 10:53:20 +0200 Subject: Fix code review notes --- spec/mixlib/cli_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec') 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 -- cgit v1.2.1