mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Merge pull request #4565 from inspec/zenspider/rspec_method_missing
Fix problem in method_missing in rspec extensions when backend unavailable.
This commit is contained in:
commit
471524711a
2 changed files with 3 additions and 0 deletions
|
@ -34,6 +34,8 @@ module Inspec::DSL
|
|||
# resource.
|
||||
|
||||
def self.method_missing_resource(backend, id, *arguments)
|
||||
return unless backend
|
||||
|
||||
begin
|
||||
require "inspec/resources/#{id}"
|
||||
rescue LoadError
|
||||
|
|
|
@ -50,6 +50,7 @@ module Inspec
|
|||
def method_missing(method_name, *arguments, &block)
|
||||
# see if it is a resource first
|
||||
begin
|
||||
inspec = inspec if respond_to?(:inspec) # backend not available??
|
||||
resource = Inspec::DSL.method_missing_resource(inspec, method_name, *arguments)
|
||||
return resource if resource
|
||||
rescue LoadError
|
||||
|
|
Loading…
Add table
Reference in a new issue