Sha256: b3f6f266d93d06575a4b6260210e25954951a2fde923d41719f9bf6499616fe4

Contents?: true

Size: 339 Bytes

Versions: 6

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :middleware, class: OpenStruct do
    receiver { -> {} }

    initialize_with do
      new(receiver: receiver).tap do |middleware|
        middleware.define_singleton_method(:call) do |task, &block|
          receiver.call(task, &block)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wayfarer-0.4.7 spec/factories/middleware.rb
wayfarer-0.4.6 spec/factories/middleware.rb
wayfarer-0.4.5 spec/factories/middleware.rb
wayfarer-0.4.4 spec/factories/middleware.rb
wayfarer-0.4.3 spec/factories/middleware.rb
wayfarer-0.4.2 spec/factories/middleware.rb