Skip to content

Commit 75750b3

Browse files
committed
complete test coverage
1 parent a46e86b commit 75750b3

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

lib/bashly/config_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def assert_env_var(key, value)
174174
end
175175

176176
def assert_var(key, value)
177-
assert_hash key, value, keys: %i[name value]
177+
assert_hash key, value, keys: Script::Variable.option_keys
178178
assert_string "#{key}.name", value['name']
179179
end
180180

spec/approvals/validations/var

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#<Bashly::ConfigurationError: root.variables[0].name must be a string>

spec/fixtures/script/validations.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,10 @@
440440
name: invalid
441441
help: root cannot have private
442442
private: true
443+
444+
:var:
445+
name: invalid
446+
help: var.name should be a string
447+
variables:
448+
- name: 1
449+
value: 2

0 commit comments

Comments
 (0)