diff --git a/lib/inspec/control_eval_context.rb b/lib/inspec/control_eval_context.rb index b635d183c..dc2b994fc 100644 --- a/lib/inspec/control_eval_context.rb +++ b/lib/inspec/control_eval_context.rb @@ -40,7 +40,8 @@ module Inspec if hook # OK, load the hook if it hasn't been already. We'll then know a module, # which we can then inject into the context - hook.activate unless hook.activated? + hook.activate + # Inject the module's methods into the context. # implementation_class is the field name, but this is actually a module. self.class.include(hook.implementation_class) diff --git a/lib/inspec/dsl.rb b/lib/inspec/dsl.rb index 8520383f0..4c59054d0 100644 --- a/lib/inspec/dsl.rb +++ b/lib/inspec/dsl.rb @@ -38,7 +38,7 @@ module Inspec::DSL if hook # OK, load the hook if it hasn't been already. We'll then know a module, # which we can then inject into the context - hook.activate unless hook.activated? + hook.activate # Inject the module's methods into the context # implementation_class is the field name, but this is actually a module. self.class.include(hook.implementation_class) diff --git a/lib/inspec/plugin/v1/plugin_types/resource.rb b/lib/inspec/plugin/v1/plugin_types/resource.rb index 078d415b8..24002443e 100644 --- a/lib/inspec/plugin/v1/plugin_types/resource.rb +++ b/lib/inspec/plugin/v1/plugin_types/resource.rb @@ -52,7 +52,7 @@ module Inspec if hook # OK, load the hook if it hasn't been already. We'll then know a module, # which we can then inject into the resource - hook.activate unless hook.activated? + hook.activate # Inject the module's methods into the resource as class methods. # implementation_class is the field name, but this is actually a module. extend(hook.implementation_class) diff --git a/lib/inspec/rspec_extensions.rb b/lib/inspec/rspec_extensions.rb index 8d477e784..7977280f9 100644 --- a/lib/inspec/rspec_extensions.rb +++ b/lib/inspec/rspec_extensions.rb @@ -17,7 +17,7 @@ module Inspec if hook # OK, load the hook if it hasn't been already. We'll then know a module, # which we can then inject into the context - hook.activate unless hook.activated? + hook.activate # Inject the module's methods into the example group contexts. # implementation_class is the field name, but this is actually a module. @@ -46,7 +46,7 @@ module Inspec if hook # OK, load the hook if it hasn't been already. We'll then know a module, # which we can then inject into the context - hook.activate unless hook.activated? + hook.activate # Inject the module's methods into the example group contexts. # implementation_class is the field name, but this is actually a module.