Sha256: 7f3f82d71137bffaeed03fa862bbe046d518fff776768e22e36c6e4dcf70716d

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

require_relative "../../share/cleans_backtrace"
require_relative "../../share/compares_safely"

module Mocktail
  class DescribesUnsatisfiedStubbing
    def initialize
      @cleans_backtrace = CleansBacktrace.new
      @compares_safely = ComparesSafely.new
    end

    def describe(dry_call)
      UnsatisfyingCall.new(
        call: dry_call,
        other_stubbings: Mocktail.cabinet.stubbings.select { |stubbing|
          @compares_safely.compare(dry_call.double, stubbing.recording.double) &&
            @compares_safely.compare(dry_call.method, stubbing.recording.method)
        },
        backtrace: @cleans_backtrace.clean(Error.new).backtrace
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mocktail-1.1.2 lib/mocktail/handles_dry_call/fulfills_stubbing/describes_unsatisfied_stubbing.rb