Merge pull request #337 from chef/dr/reload-dsl

Fix custom resource loading from `libraries`
This commit is contained in:
Christoph Hartmann 2015-12-29 21:01:16 +01:00
commit 246ae0eca5
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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