summaryrefslogtreecommitdiff
path: root/test/option_test.rb
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2012-01-06 12:22:38 +0000
committerLee Jarvis <lee@jarvis.co>2012-01-06 12:22:38 +0000
commitec0e4c3deff6a14857fc955d9314c5d35da6c82d (patch)
treef29973a982f1b91af475c1b33ea5ea6aaabdf1d4 /test/option_test.rb
parent844d13e894a1d04afe00119f9d3ed238a966ac9b (diff)
downloadslop-ec0e4c3deff6a14857fc955d9314c5d35da6c82d.tar.gz
clean up array cast tests
Diffstat (limited to 'test/option_test.rb')
-rw-r--r--test/option_test.rb24
1 files changed, 5 insertions, 19 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
index fe5419f..49d70d9 100644
--- a/test/option_test.rb
+++ b/test/option_test.rb
@@ -68,24 +68,10 @@ class OptionTest < TestCase
assert_equal (1..-10), option_value(%w/-r 1..-10/, :r=, :as => Range)
end
- test 'splits argument_value with :as => array' do
- assert_equal %w/lee john bill/, option_value(
- %w/--people lee,john,bill/, :people=, :as => Array
- )
-
- assert_equal %w/lee john bill/, option_value(
- %w/--people lee:john:bill/,
- :people=, :as => Array, :delimiter => ':'
- )
-
- assert_equal ['lee', 'john,bill'], option_value(
- %w/--people lee,john,bill/,
- :people=, :as => Array, :limit => 2
- )
-
- assert_equal ['lee', 'john:bill'], option_value(
- %w/--people lee:john:bill/,
- :people=, :as => Array, :limit => 2, :delimiter => ':'
- )
+ test 'array type cast' do
+ assert_equal %w/lee john bill/, option_value(%w/-p lee,john,bill/, :p=, :as => Array)
+ assert_equal %w/lee john bill/, option_value(%w/-p lee:john:bill/, :p=, :as => Array, :delimiter => ':')
+ assert_equal %w/lee john,bill/, option_value(%w/-p lee,john,bill/, :p=, :as => Array, :limit => 2)
+ assert_equal %w/lee john:bill/, option_value(%w/-p lee:john:bill/, :p=, :as => Array, :limit => 2, :delimiter => ':')
end
end \ No newline at end of file