diff --git a/lib/onceover/testconfig.rb b/lib/onceover/testconfig.rb index 49758f96..485a3fe9 100644 --- a/lib/onceover/testconfig.rb +++ b/lib/onceover/testconfig.rb @@ -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)