Sha256: 6e031361b96f50403d91589bdb6ac93e0ec34823089443fa68bb13962347c2e2

Contents?: true

Size: 452 Bytes

Versions: 5

Compression:

Stored size: 452 Bytes

Contents

module Spy
  class Double
    def initialize(name, *args)
      @name = name

      if args.size > 0
        Spy.on(self,*args)
      end
    end

    # @private
    def ==(other)
      other == self
    end

    # @private
    def inspect
      "#<#{self.class}:#{sprintf '0x%x', self.object_id} @name=#{@name.inspect}>"
    end

    # @private
    def to_s
      inspect.gsub('<','[').gsub('>',']')
    end

    alias_method :to_str, :to_s
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spy-0.2.5 lib/spy/double.rb
spy-0.2.4 lib/spy/double.rb
spy-0.2.3 lib/spy/double.rb
spy-0.2.2 lib/spy/double.rb
spy-0.2.1 lib/spy/double.rb