mirror of
https://github.com/inspec/inspec
synced 2025-01-30 22:03:34 +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
|
# author: Christoph Hartmann
|
||||||
|
|
||||||
module Inspec::DSL
|
module Inspec::DSL
|
||||||
def require_rules(id, &block)
|
def require_controls(id, &block)
|
||||||
::Inspec::DSL.load_spec_files_for_profile self, id, false, &block
|
::Inspec::DSL.load_spec_files_for_profile self, id, false, &block
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_rules(id, &block)
|
def include_controls(id, &block)
|
||||||
::Inspec::DSL.load_spec_files_for_profile self, id, true, &block
|
::Inspec::DSL.load_spec_files_for_profile self, id, true, &block
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias_method :require_rules, :require_controls
|
||||||
|
alias_method :include_rules, :include_controls
|
||||||
|
|
||||||
# Register a given rule with RSpec and
|
# Register a given rule with RSpec and
|
||||||
# let it run. This happens after everything
|
# let it run. This happens after everything
|
||||||
# else is merged in.
|
# else is merged in.
|
||||||
|
|
|
@ -92,13 +92,15 @@ module Inspec
|
||||||
Class.new do
|
Class.new do
|
||||||
include dsl
|
include dsl
|
||||||
|
|
||||||
define_method :rule do |*args, &block|
|
define_method :control do |*args, &block|
|
||||||
id = args[0]
|
id = args[0]
|
||||||
opts = args[1] || {}
|
opts = args[1] || {}
|
||||||
return if @skip_profile
|
return if @skip_profile
|
||||||
__register_rule rule_class.new(id, opts, &block)
|
__register_rule rule_class.new(id, opts, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias_method :rule, :control
|
||||||
|
|
||||||
define_method :describe do |*args, &block|
|
define_method :describe do |*args, &block|
|
||||||
path = block.source_location[0]
|
path = block.source_location[0]
|
||||||
line = block.source_location[1]
|
line = block.source_location[1]
|
||||||
|
|
Loading…
Reference in a new issue