Class: WebMock::RequestBodyDiff::PrettyPrintableThingy

Inherits:
Struct
  • Object
show all
Defined in:
lib/specdiff/webmock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#specdiffObject

Returns the value of attribute specdiff

Returns:

  • (Object)

    the current value of specdiff



11
12
13
# File 'lib/specdiff/webmock.rb', line 11

def specdiff
  @specdiff
end

Instance Method Details

#empty?Boolean

webmock does not print the diff if it responds true to this.

Returns:

  • (Boolean)


13
14
15
# File 'lib/specdiff/webmock.rb', line 13

def empty?
  specdiff.empty?
end

#pretty_print(pp) ⇒ Object

webmock prints the diff by passing us to PP.pp, which in turn uses this method.



19
20
21
22
# File 'lib/specdiff/webmock.rb', line 19

def pretty_print(pp)
  pp.text("\r") # remove a space that isn't supposed to be there
  pp.text(specdiff.to_s)
end