summaryrefslogtreecommitdiff
path: root/test/option_test.rb
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2012-01-12 14:24:36 +0000
committerLee Jarvis <lee@jarvis.co>2012-01-12 14:24:36 +0000
commit98655067cbe8294057407d42033fd09c9fe61140 (patch)
tree95eac0d9421540e59884eef356f59901cd69a689 /test/option_test.rb
parent1fba512b8c76bfd968dd7514a6009b07f1c25776 (diff)
downloadslop-98655067cbe8294057407d42033fd09c9fe61140.tar.gz
test :default value
Diffstat (limited to 'test/option_test.rb')
-rw-r--r--test/option_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
index be0ede0..cfe7620 100644
--- a/test/option_test.rb
+++ b/test/option_test.rb
@@ -83,5 +83,12 @@ class OptionTest < TestCase
assert_equal 'rab', opt.value
end
+ test "using a default value as fallback" do
+ opts = Slop.new
+ opt = opts.on :f, :argument => :optional, :default => 'foo'
+ opts.parse %w'-f'
+ assert_equal 'foo', opts[:f]
+ end
+
# end type casting tests
end \ No newline at end of file