diff options
author | Lee Jarvis <lee@jarvis.co> | 2011-04-14 12:09:54 +0100 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2011-04-14 12:09:54 +0100 |
commit | 9bb02e743fd6520260a667523a5d83843757487b (patch) | |
tree | a7023b191c207de62af9e669f010e76521af7920 /test/option_test.rb | |
parent | 6bb0a0c3eb6865ac77641d8e45809a2ff077a0e6 (diff) | |
download | slop-9bb02e743fd6520260a667523a5d83843757487b.tar.gz |
first try at ranges
Diffstat (limited to 'test/option_test.rb')
-rw-r--r-- | test/option_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/option_test.rb b/test/option_test.rb index 422e696..d49548a 100644 --- a/test/option_test.rb +++ b/test/option_test.rb @@ -67,6 +67,13 @@ class OptionTest < TestCase assert_equal "1.0", option_value(%w/--id 1/, :id, true, :as => Float).to_s end + test 'ranges' do + assert_equal (1..10), option_value(%w/-r 1..10/, :r, true, :as => Range) + assert_equal (1..10), option_value(%w/-r 1-10/, :r, true, :as => Range) + assert_equal (1..10), option_value(%w/-r 1,10/, :r, true, :as => Range) + assert_equal (1...10), option_value(%w/-r 1...10/, :r, true, :as => Range) + end + test 'printing options' do slop = Slop.new slop.opt :n, :name, 'Your name', true |