mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Merge pull request #194 from chef/control
Merged change d8c2c7f3-57be-43c5-8e33-6aaae42e27ec From review branch control into master Signed-off-by: chartmann <chartmann@chef.io>
This commit is contained in:
commit
5b5bb307fb
2 changed files with 8 additions and 3 deletions
|
@ -5,14 +5,17 @@
|
|||
# author: Christoph Hartmann
|
||||
|
||||
module Inspec::DSL
|
||||
def require_rules(id, &block)
|
||||
def require_controls(id, &block)
|
||||
::Inspec::DSL.load_spec_files_for_profile self, id, false, &block
|
||||
end
|
||||
|
||||
def include_rules(id, &block)
|
||||
def include_controls(id, &block)
|
||||
::Inspec::DSL.load_spec_files_for_profile self, id, true, &block
|
||||
end
|
||||
|
||||
alias_method :require_rules, :require_controls
|
||||
alias_method :include_rules, :include_controls
|
||||
|
||||
# Register a given rule with RSpec and
|
||||
# let it run. This happens after everything
|
||||
# else is merged in.
|
||||
|
|
|
@ -92,13 +92,15 @@ module Inspec
|
|||
Class.new do
|
||||
include dsl
|
||||
|
||||
define_method :rule do |*args, &block|
|
||||
define_method :control do |*args, &block|
|
||||
id = args[0]
|
||||
opts = args[1] || {}
|
||||
return if @skip_profile
|
||||
__register_rule rule_class.new(id, opts, &block)
|
||||
end
|
||||
|
||||
alias_method :rule, :control
|
||||
|
||||
define_method :describe do |*args, &block|
|
||||
path = block.source_location[0]
|
||||
line = block.source_location[1]
|
||||
|
|
Loading…
Reference in a new issue