mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
Merge pull request #4549 from inspec/zenspider/describe.one
Added method_missing to Inspec::DescribeBase (used by describe.one) to fix resource loading
This commit is contained in:
commit
a4090f9c1c
2 changed files with 11 additions and 8 deletions
|
@ -17,6 +17,10 @@ module Inspec
|
||||||
@action.call("describe.one", @checks, nil)
|
@action.call("describe.one", @checks, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def method_missing(method_name, *arguments)
|
||||||
|
Inspec::DSL.method_missing_resource(inspec, method_name, *arguments)
|
||||||
|
end
|
||||||
|
|
||||||
def describe(*args, &block)
|
def describe(*args, &block)
|
||||||
@checks.push(["describe", args, block])
|
@checks.push(["describe", args, block])
|
||||||
end
|
end
|
||||||
|
|
|
@ -344,14 +344,13 @@ module Inspec
|
||||||
def with_dsl(block)
|
def with_dsl(block)
|
||||||
return nil if block.nil?
|
return nil if block.nil?
|
||||||
|
|
||||||
if self.class.resource_dsl
|
dsl = self.class.resource_dsl
|
||||||
dsl = self.class.resource_dsl
|
|
||||||
proc do |*args|
|
return block unless dsl
|
||||||
include dsl
|
|
||||||
instance_exec(*args, &block)
|
proc do |*args|
|
||||||
end
|
include dsl
|
||||||
else
|
instance_exec(*args, &block)
|
||||||
block
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue