Method: Inspec::DSL.execute_rule

Defined in:
lib/inspec/dsl.rb

.execute_rule(r, profile_id) ⇒ Object

Register a given rule with RSpec and let it run. This happens after everything else is merged in.



35
36
37
38
39
40
41
42
43
# File 'lib/inspec/dsl.rb', line 35

def self.execute_rule(r, profile_id)
  checks = r.instance_variable_get(:@checks)
  fid = InspecBaseRule.full_id(r, profile_id)
  checks.each do |m, a, b|
    # check if the resource is skippable and skipped
    cres = rule_from_check(m, a, b)
    set_rspec_ids(cres, fid) if m == 'describe'
  end
end