Class: WebMock::RequestBodyDiff

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

Instance Method Summary collapse

Constructor Details

#initialize(request_signature, request_stub) ⇒ RequestBodyDiff

Returns a new instance of RequestBodyDiff.



9
10
11
12
# File 'lib/webmock/request_body_diff.rb', line 9

def initialize(request_signature, request_stub)
  @request_signature = request_signature
  @request_stub      = request_stub
end

Instance Method Details

#body_diffObject



14
15
16
17
18
# File 'lib/webmock/request_body_diff.rb', line 14

def body_diff
  return {} unless request_signature_diffable? && request_stub_diffable?

  Hashdiff.diff(request_signature_body_hash, request_stub_body_hash)
end