diff options
Diffstat (limited to 'test/types_test.rb')
-rw-r--r-- | test/types_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/types_test.rb b/test/types_test.rb index a45302a..ea2ba8d 100644 --- a/test/types_test.rb +++ b/test/types_test.rb @@ -34,9 +34,11 @@ describe Slop::BoolOption do @verbose = @options.bool "--verbose" @quiet = @options.bool "--quiet" @inversed = @options.bool "--inversed", default: true + @explicit = @options.bool "--explicit" @bloc = @options.bool("--bloc"){|val| (@bloc_val ||= []) << val} @result = @options.parse %w(--verbose --no-inversed - --bloc --no-bloc) + --bloc --no-bloc + --explicit=false) end it "returns true if used" do @@ -54,6 +56,10 @@ describe Slop::BoolOption do it "will invert the value passed to &block via --no- prefix" do assert_equal [true, false], @bloc_val end + + it "returns false when explicitly false" do + assert_equal false, @result[:explicit] + end end describe Slop::IntegerOption do |