Sha256: 2f4e1880fff2e32ba3a5831f01e05e2930ff35a322eecf0b24a0883ef39aa34a

Contents?: true

Size: 430 Bytes

Versions: 6

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

module Assert; end
class Assert::Context; end

module Assert::Context::LetDSL
  def let(name, &block)
    send(:define_method, name, &->{
      unless instance_variable_defined?("@__assert_let_#{name}__")
        instance_variable_set(
          "@__assert_let_#{name}__",
          instance_eval(&block),
        )
      end

      instance_variable_get("@__assert_let_#{name}__")
    })
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
assert-2.19.8 lib/assert/context/let_dsl.rb
assert-2.19.7 lib/assert/context/let_dsl.rb
assert-2.19.6 lib/assert/context/let_dsl.rb
assert-2.19.5 lib/assert/context/let_dsl.rb
assert-2.19.4 lib/assert/context/let_dsl.rb
assert-2.19.3 lib/assert/context/let_dsl.rb