@@ -24,7 +24,7 @@ def assert_version(key, value)
24
24
def assert_catch_all ( key , value )
25
25
return unless value
26
26
27
- assert [ TrueClass , String , Hash ] . include? ( value . class ) ,
27
+ assert [ TrueClass , FalseClass , String , Hash ] . include? ( value . class ) ,
28
28
"#{ key } must be a boolean, a string or a hash"
29
29
30
30
assert_catch_all_hash key , value if value . is_a? Hash
@@ -77,7 +77,7 @@ def assert_dependency(key, value)
77
77
def assert_extensible ( key , value )
78
78
return unless value
79
79
80
- assert [ TrueClass , String ] . include? ( value . class ) ,
80
+ assert [ TrueClass , FalseClass , String ] . include? ( value . class ) ,
81
81
"#{ key } must be a boolean or a string"
82
82
end
83
83
@@ -173,6 +173,11 @@ def assert_env_var(key, value)
173
173
refute value [ 'required' ] && value [ 'default' ] , "#{ key } cannot have both nub`required` and nub`default`"
174
174
end
175
175
176
+ def assert_var ( key , value )
177
+ assert_hash key , value , keys : %i[ name value ]
178
+ assert_string "#{ key } .name" , value [ 'name' ]
179
+ end
180
+
176
181
def assert_command ( key , value )
177
182
assert_hash key , value , keys : Script ::Command . option_keys
178
183
@@ -207,6 +212,7 @@ def assert_command(key, value)
207
212
assert_array "#{ key } .completions" , value [ 'completions' ] , of : :string
208
213
assert_array "#{ key } .filters" , value [ 'filters' ] , of : :string
209
214
assert_array "#{ key } .environment_variables" , value [ 'environment_variables' ] , of : :env_var
215
+ assert_array "#{ key } .variables" , value [ 'variables' ] , of : :var
210
216
211
217
assert_uniq "#{ key } .commands" , value [ 'commands' ] , %w[ name alias ]
212
218
assert_uniq "#{ key } .flags" , value [ 'flags' ] , 'long'
0 commit comments