Sha256: ad8ad30bc5ffe9b117b7cfbf14134f4b4564e86946139f9266445ab783fda920

Contents?: true

Size: 415 Bytes

Versions: 1

Compression:

Stored size: 415 Bytes

Contents

# typed: strict

module Mocktail
  class CollectsCalls
    extend T::Sig

    sig { params(double: Object, method_name: T.nilable(Symbol)).returns(T::Array[Call]) }
    def collect(double, method_name)
      calls = ExplainsThing.new.explain(double).reference.calls

      if method_name.nil?
        calls
      else
        calls.select { |call| call.method.to_s == method_name.to_s }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mocktail-2.0.0 lib/mocktail/sorbet/mocktail/collects_calls.rb