module RSpec::Strict::Let

Constants

DEFINITIONS

Public Instance Methods

let(name, &block) click to toggle source
Calls superclass method
# File lib/rspec/lint.rb, line 6
def let(name, &block)
  definition = caller.first.dup.freeze
  Let::DEFINITIONS[definition] = name

  super

  wrapper =
    Module.new do
      define_method(name) do
        Let::DEFINITIONS.delete(definition)

        super()
      end
    end

  prepend(wrapper)
end