summaryrefslogtreecommitdiff
path: root/test/option_test.rb
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-04-14 21:07:43 +0100
committerLee Jarvis <lee@jarvis.co>2011-04-14 21:07:43 +0100
commitf45d5e64091b91ff8c07916698815838bfa6cd71 (patch)
treefd77e23057b54799ef438bca32b09c20cdf52ee0 /test/option_test.rb
parent84c12a31dc3479125f718725a183221a31a9ce5f (diff)
downloadslop-f45d5e64091b91ff8c07916698815838bfa6cd71.tar.gz
have :as => Range return an integer if the value is numeric only
Diffstat (limited to 'test/option_test.rb')
-rw-r--r--test/option_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
index 68b4cf3..07168f5 100644
--- a/test/option_test.rb
+++ b/test/option_test.rb
@@ -74,8 +74,10 @@ class OptionTest < TestCase
assert_equal (1...10), option_value(%w/-r 1...10/, :r, true, :as => Range)
# default back to the string unless a regex is successful
+ # return value.to_i if the value is /\A\d+\z/
# maybe this should raise is Slop#strict?
assert_equal "1abc10", option_value(%w/-r 1abc10/, :r, true, :as => Range)
+ assert_equal 1, option_value(%w/-r 1/, :r, true, :as => Range)
end
test 'printing options' do