Class: Module

Inherits:
Object
  • Object
show all
Includes:
Minitest::Spec::DSL
Defined in:
lib/plugins/shared/core_plugin_test_helper.rb,
lib/inspec/resource.rb,
lib/inspec/profile_context.rb

Overview

Configure Minitest to expose things like ‘let`

Instance Method Summary collapse

Instance Method Details

#find_class_instance_variable(k) ⇒ Object

Any use of this is an anti-pattern caused by our use of negligent design and metaprogramming nonsense. We should work it out… but there are many hurdles in our way.



257
258
259
260
261
# File 'lib/inspec/resource.rb', line 257

def find_class_instance_variable(k)
  (ancestors - Object.ancestors)
    .find { |cls| cls.instance_variable_defined?(k) }
    &.instance_variable_get(k)
end