Sha256: e129b9c38d7a1512feb9b082e58aa46442773312b563590400c6f330b0f17d25

Contents?: true

Size: 865 Bytes

Versions: 12

Compression:

Stored size: 865 Bytes

Contents

module RR
  class RecordedCall < Struct.new(:subject,
                                  :method_name,
                                  :arguments,
                                  :keyword_arguments,
                                  :block)
    def inspect
      '[%s, %s, %s, %s, %s]' % [
        subject_to_s,
        method_name.inspect,
        arguments.inspect,
        keyword_arguments.inspect,
        block.inspect
      ]
    end

    def ==(other)
      other.is_a?(self.class) &&
        subject == other.subject &&
        method_name == other.method_name &&
        arguments == other.arguments &&
        keyword_arguments == other.keyword_arguments
    end

    private

    def subject_to_s
      if subject.respond_to?(:__rr__original_to_s, true)
        subject.__rr__original_to_s
      else
        subject.to_s
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rr-3.1.1 lib/rr/recorded_call.rb
rr-3.1.0 lib/rr/recorded_call.rb
rr-3.0.9 lib/rr/recorded_call.rb
rr-3.0.8 lib/rr/recorded_call.rb
rr-3.0.7 lib/rr/recorded_call.rb
rr-3.0.6 lib/rr/recorded_call.rb
rr-3.0.5 lib/rr/recorded_call.rb
rr-3.0.4 lib/rr/recorded_call.rb
rr-3.0.3 lib/rr/recorded_call.rb
rr-3.0.2 lib/rr/recorded_call.rb
rr-3.0.1 lib/rr/recorded_call.rb
rr-3.0.0 lib/rr/recorded_call.rb