summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/options_test.rb13
1 files changed, 12 insertions, 1 deletions
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