summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2012-01-15 12:26:46 +0000
committerLee Jarvis <lee@jarvis.co>2012-01-15 12:26:46 +0000
commit30cbc470a59493f31206da7ce0e54e182ef8e0d8 (patch)
tree523ceaf81d845fcd8cf692a1f64ed95436eae017 /test
parent077e71a1f56ae1fa820278d934944834074cafa5 (diff)
downloadslop-30cbc470a59493f31206da7ce0e54e182ef8e0d8.tar.gz
overwriting option help text
Diffstat (limited to 'test')
-rw-r--r--test/option_test.rb24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
index 3aa59f4..eff283b 100644
--- a/test/option_test.rb
+++ b/test/option_test.rb
@@ -93,13 +93,19 @@ class OptionTest < TestCase
end
test "printing options" do
- slop = Slop.new
- slop.opt :n, :name=, 'Your name'
- slop.opt :age=, 'Your age'
- slop.opt :V, 'Display the version'
-
- assert_equal " -n, --name Your name", slop.fetch_option(:name).to_s
- assert_equal " --age Your age", slop.fetch_option(:age).to_s
- assert_equal " -V, Display the version", slop.fetch_option(:V).help
- end
+ slop = Slop.new
+ slop.opt :n, :name=, 'Your name'
+ slop.opt :age=, 'Your age'
+ slop.opt :V, 'Display the version'
+
+ assert_equal " -n, --name Your name", slop.fetch_option(:name).to_s
+ assert_equal " --age Your age", slop.fetch_option(:age).to_s
+ assert_equal " -V, Display the version", slop.fetch_option(:V).help
+ end
+
+ test "overwriting the help text" do
+ slop = Slop.new
+ slop.on :foo, :help => ' -f, --foo SOMETHING FOOEY'
+ assert_equal ' -f, --foo SOMETHING FOOEY', slop.fetch_option(:foo).help
+ end
end \ No newline at end of file