Skip to content

Commit

Permalink
Check Node/Classes hashes
Browse files Browse the repository at this point in the history
This update checks the Node and Classes nodes contians an `exclude` if
`include` is in the hash. This allows a fail-early scenario.
  • Loading branch information
beergeek committed May 11, 2018
1 parent c902b4f commit 8b95b2a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/onceover/testconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ def self.subtractive_to_list(subtractive_hash)
# { 'include' => 'somegroup'
# 'exclude' => 'other'}
# and return a list of classes/nodes
include_list = Onceover::TestConfig.find_list(subtractive_hash['include']).flatten
exclude_list = Onceover::TestConfig.find_list(subtractive_hash['exclude']).flatten
include_list - exclude_list
if subtractive_hash.has_key?('include') && subtractive_hash.has_key?('exclude')
include_list = Onceover::TestConfig.find_list(subtractive_hash['include']).flatten
exclude_list = Onceover::TestConfig.find_list(subtractive_hash['exclude']).flatten
include_list - exclude_list
else
raise "The classes/nodes hash must have an `exclude` if using an `include`"
end
end

def verify_spec_test(controlrepo, test)
Expand Down

0 comments on commit 8b95b2a

Please sign in to comment.