Sha256: acd063bd8e6c22a9e9a88bfe757a1f78e920fa187d55bfda49399d2c31d60272

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

require 'date'

class Object
  def mocha_inspect
    inspect =~ /#</ ? "#<#{self.class}:0x#{self.__id__.to_s(16)}>" : inspect
  end
end

class String
  def mocha_inspect
    inspect.gsub(/\"/, "'")
  end
end

class Array
  def mocha_inspect
    "[#{collect { |member| member.mocha_inspect }.join(', ')}]"
  end
end

class Hash
  def mocha_inspect
    "{#{collect { |key, value| "#{key.mocha_inspect} => #{value.mocha_inspect}" }.join(', ')}}"
  end
end

class Time
  def mocha_inspect
    "#{inspect} (#{to_f} secs)"
  end
end

class Date
  def mocha_inspect
    to_s
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
greatseth-google-geo-2.0 vendor/mocha-0.4.0/lib/mocha/inspect.rb
greatseth-google-geo-2.1 vendor/mocha-0.4.0/lib/mocha/inspect.rb
greatseth-google-geo-2.2 vendor/mocha-0.4.0/lib/mocha/inspect.rb
google-geo-2.3 vendor/mocha-0.4.0/lib/mocha/inspect.rb
google-geo-2.0 vendor/mocha-0.4.0/lib/mocha/inspect.rb
google-geo-2.1 vendor/mocha-0.4.0/lib/mocha/inspect.rb
mocha-0.4.0 lib/mocha/inspect.rb
puppet-0.22.4 test/lib/mocha/inspect.rb
puppet-0.23.0 test/lib/mocha/inspect.rb
puppet-0.23.1 test/lib/mocha/inspect.rb
puppet-0.23.2 test/lib/mocha/inspect.rb