File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ module CliInternalDynamicValidationFeature
55
66 class Command < Cli::Command
77 class Options
8- # arg_array "name" do |definition|
9- # definition.on_validate do |context|
10- # context.validate_element_inclusion context .command.expected
11- # end
12- # end
8+ arg_array " name" do |definition |
9+ definition.on_validate do |context , options |
10+ context.validate_element_inclusion options .command.expected
11+ end
12+ end
1313 end
1414
1515 def expected
@@ -19,19 +19,19 @@ module CliInternalDynamicValidationFeature
1919
2020 class Command2 < Cli::Command
2121 class Options
22- # arg_array "name" do |definition|
23- # definition.on_validate do |context|
24- # context.validate_element_inclusion context .command.expected2
25- # end
26- # end
22+ arg_array " name" do |definition |
23+ definition.on_validate do |context , options |
24+ context.validate_element_inclusion options .command.expected2
25+ end
26+ end
2727 end
2828
2929 def expected2
3030 %w(foo bar baz)
3131 end
3232 end
3333
34- pending name do
34+ it name do
3535 Command .run(%w(other) ).should exit_command(error: /^Parsing Error: / )
3636 Command2 .run(%w(other) ).should exit_command(error: /^Parsing Error: / )
3737 end
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ module Cli::Helps
126126
127127 def inclusion_of2 (incl )
128128 a = incl.values.map do |v |
129- desc = if md = v.metadata.as?(OptionValueMetadata )
129+ desc = if md = v.metadata.as?(OptionValueMetadata ( String ) )
130130 md.description
131131 end
132132 Description .new(head: v.metadata.string, body: desc ? desc.split(" \n " ) : %w() )
You can’t perform that action at this time.
0 commit comments