summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhil Rees <philrees@gmail.com>2016-03-15 16:51:30 -0400
committerPhil Rees <philrees@gmail.com>2016-03-18 20:31:28 -0400
commitd67a1b63f5232adb33acbfb03a79e51695a7ab88 (patch)
treef45173d08af11926d2dfb117c734a61ee36fcf88 /test
parent601f498d572a37cb818bcb78f32aee286e8ff70a (diff)
downloadslop-d67a1b63f5232adb33acbfb03a79e51695a7ab88.tar.gz
Can specify a custom banner string in Options via config
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