summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2013-01-08 11:44:01 +0000
committerLee Jarvis <ljjarvis@gmail.com>2013-01-08 11:44:01 +0000
commit93ec4d29629be94747d98e924369bc4e49606aea (patch)
tree7a7e1a30b8bae97ba2c3330236f00eba2b64c857 /test
parent0a4ccdb268c3cddb80a427a509a0243c54f3dd16 (diff)
downloadslop-93ec4d29629be94747d98e924369bc4e49606aea.tar.gz
added default usage string to help output
Diffstat (limited to 'test')
-rw-r--r--test/slop_test.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index 9e2d91a..b066e49 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -314,7 +314,7 @@ class SlopTest < TestCase
end
test "separators" do
- opts = Slop.new do
+ opts = Slop.new(banner: false) do
on :foo
separator "hello"
separator "world"
@@ -331,10 +331,16 @@ class SlopTest < TestCase
test "printing help with :help => true" do
temp_stderr do |string|
- opts = Slop.new(:help => true)
+ opts = Slop.new(:help => true, :banner => false)
opts.parse %w( --help )
assert_equal " -h, --help Display this help message.\n", string
end
+
+ temp_stderr do |string|
+ opts = Slop.new(:help => true)
+ opts.parse %w( --help )
+ assert_equal "Usage: rake_test_loader [options]\n -h, --help Display this help message.\n", string
+ end
end
test "fallback to substituting - for _ when using <option>?" do