mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
Merge pull request #337 from chef/dr/reload-dsl
Fix custom resource loading from `libraries`
This commit is contained in:
commit
246ae0eca5
2 changed files with 7 additions and 2 deletions
|
@ -19,11 +19,15 @@ module Inspec
|
|||
@profile_id = profile_id
|
||||
@rules = profile_registry
|
||||
@only_ifs = only_ifs
|
||||
@backend = backend
|
||||
|
||||
dsl = create_inner_dsl(backend)
|
||||
reload_dsl
|
||||
end
|
||||
|
||||
def reload_dsl
|
||||
dsl = create_inner_dsl(@backend)
|
||||
outer_dsl = create_outer_dsl(dsl)
|
||||
ctx = create_context(outer_dsl)
|
||||
|
||||
@profile_context = ctx.new
|
||||
end
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ module Inspec
|
|||
ctx = create_context
|
||||
libs.each do |lib|
|
||||
ctx.load(lib[:content].to_s, lib[:ref], lib[:line] || 1)
|
||||
ctx.reload_dsl
|
||||
end
|
||||
|
||||
# evaluate the test content
|
||||
|
|
Loading…
Reference in a new issue