summaryrefslogtreecommitdiff
path: root/test/option_test.rb
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2012-01-06 12:20:30 +0000
committerLee Jarvis <lee@jarvis.co>2012-01-06 12:20:30 +0000
commit844d13e894a1d04afe00119f9d3ed238a966ac9b (patch)
tree76c94053251168becb6e79b1661e6a9893ffe3de /test/option_test.rb
parentdae8c70f80df8097f3d94e0a76d3ead91c0fca52 (diff)
downloadslop-844d13e894a1d04afe00119f9d3ed238a966ac9b.tar.gz
ensure :as => Array splits string arguments
Diffstat (limited to 'test/option_test.rb')
-rw-r--r--test/option_test.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
index 3afa33d..fe5419f 100644
--- a/test/option_test.rb
+++ b/test/option_test.rb
@@ -68,24 +68,24 @@ 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 => ':'
- # )
- # 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 => ':'
+ )
+ end
end \ No newline at end of file