Sha256: 6fa36f07833a31e1f28c487073ff3f98ad4b5267b448056c0eb51d23a002bb83

Contents?: true

Size: 331 Bytes

Versions: 2

Compression:

Stored size: 331 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wayfarer-0.4.1 spec/factories/queue/middleware.rb
wayfarer-0.4.0 spec/factories/queue/middleware.rb