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

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.



263
264
265
266
267
# File 'lib/inspec/resource.rb', line 263

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