test/como_options in como-0.1.1 vs test/como_options in como-0.1.2
- old
+ new
@@ -3,11 +3,11 @@
require "../lib/como"
include Como
Spec.command( "como_options", "Como Tester", "2013",
[
- [ :exclusive, "doc", nil, "Documentation." ],
+ [ :exclusive, "doc", nil, "Documentation for option\n\twith too much description\n\tfor one line." ],
[ :single, "file", "-f", "File argument." ],
[ :switch, "debug", nil, "Enable debugging." ],
[ :opt_single, "mode", "-m", "Mode." ],
[ :opt_multi, "params", nil, "Parameters." ],
[ :opt_any, "types", "-t", "Types." ],
@@ -17,19 +17,10 @@
] )
Opt.each do |o|
puts "Given \"#{o.name}\": #{o.given}"
-end
-
-Opt.each_given do |o|
- puts "Value \"#{o.name}\": #{o.value}"
-end
-
-Opt[ 'params' ].given( true ) do |o|
- o.params.each do |k,v|
- puts "Param #{k}: #{v}"
- end
+ puts "Value \"#{o.name}\": #{o.value}" if o.given && o.value
end
if Opt.external
puts "External: #{Opt.external}"
end