Sha256: b9273d05ee5d9d4a7b2f3bce548e9f88d4238b121f5c7c52aed93231949ade1d
Contents?: true
Size: 442 Bytes
Versions: 9
Compression:
Stored size: 442 Bytes
Contents
# frozen_string_literal: true module RepositoryStubber def stub_repository(repository:, expected_output:, response: :success, params: nil) monads = response.to_s.eql?('success') ? Dry::Monads::Success(expected_output) : Dry::Monads::Failure(expected_output) expectation = allow(repository).to receive(:new) expectation.with(params) if params expectation.and_return(instance_double(repository, call: monads)) end end
Version data entries
9 entries across 9 versions & 1 rubygems