diff --git a/lib/inspec/profile_context.rb b/lib/inspec/profile_context.rb index 6bd84aa3a..48da54ffb 100644 --- a/lib/inspec/profile_context.rb +++ b/lib/inspec/profile_context.rb @@ -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 diff --git a/lib/inspec/runner.rb b/lib/inspec/runner.rb index 836547820..777d0f5b3 100644 --- a/lib/inspec/runner.rb +++ b/lib/inspec/runner.rb @@ -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