From d67a1b63f5232adb33acbfb03a79e51695a7ab88 Mon Sep 17 00:00:00 2001 From: Phil Rees Date: Tue, 15 Mar 2016 16:51:30 -0400 Subject: Can specify a custom banner string in Options via config --- test/options_test.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/options_test.rb b/test/options_test.rb index 65461db..bb19210 100644 --- a/test/options_test.rb +++ b/test/options_test.rb @@ -55,7 +55,7 @@ describe Slop::Options do end describe "#to_s" do - it "is prefixed with the banner" do + it "is prefixed with the default banner" do assert_match(/^usage/, @options.to_s) end @@ -82,4 +82,15 @@ describe Slop::Options do assert_match(/^ -h, --help/, @options.to_s.lines.last) end end + + describe "custom banner" do + it "is prefixed with defined banner" do + @options_config = Slop::Options.new({banner: "custom banner"}) + assert_match(/^custom banner/, @options_config.to_s) + end + it "banner is disabled" do + @options_config = Slop::Options.new({banner: false}) + assert_match("", @options_config.to_s) + end + end end -- cgit v1.2.1