diff options
Diffstat (limited to 'test/options_test.rb')
-rw-r--r-- | test/options_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/options_test.rb b/test/options_test.rb index 2f83fc4..0aa6e67 100644 --- a/test/options_test.rb +++ b/test/options_test.rb @@ -70,6 +70,17 @@ describe Slop::Options do assert_equal [""], @options.separators end + + it "correctly handles options with `help: false`" do + @options.boolean "--opt1" + @options.boolean "--opt2", help: false + @options.separator "other options" + @options.boolean "--opt3", help: false + @options.boolean "--opt4" + + _usage, help = @options.to_s.squeeze(" ").split("\n", 2) + assert_equal "--opt1 \nother options\n --opt4", help.strip + end end describe "#method_missing" do |