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:
Clinton Wolfe 2019-10-02 00:06:56 -04:00 committed by GitHub
commit a4090f9c1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View file

@ -17,6 +17,10 @@ module Inspec
@action.call("describe.one", @checks, nil)
end
def method_missing(method_name, *arguments)
Inspec::DSL.method_missing_resource(inspec, method_name, *arguments)
end
def describe(*args, &block)
@checks.push(["describe", args, block])
end

View file

@ -344,14 +344,13 @@ module Inspec
def with_dsl(block)
return nil if block.nil?
if self.class.resource_dsl
dsl = self.class.resource_dsl
proc do |*args|
include dsl
instance_exec(*args, &block)
end
else
block
dsl = self.class.resource_dsl
return block unless dsl
proc do |*args|
include dsl
instance_exec(*args, &block)
end
end