diff options
author | Lee Jarvis <lee@jarvis.co> | 2012-01-06 12:20:30 +0000 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2012-01-06 12:20:30 +0000 |
commit | 844d13e894a1d04afe00119f9d3ed238a966ac9b (patch) | |
tree | 76c94053251168becb6e79b1661e6a9893ffe3de /test/option_test.rb | |
parent | dae8c70f80df8097f3d94e0a76d3ead91c0fca52 (diff) | |
download | slop-844d13e894a1d04afe00119f9d3ed238a966ac9b.tar.gz |
ensure :as => Array splits string arguments
Diffstat (limited to 'test/option_test.rb')
-rw-r--r-- | test/option_test.rb | 40 |
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 |