webmock

https://github.com/bblimke/webmock

Ruby

Library for stubbing and setting expectations on HTTP requests in Ruby.

WebMock::BodyPattern#matching_hashes?

Compare two hashes for equality

For two hashes to match they must have the same length and all
values must match when compared using `#===`.

The following hashes are examples of matches:

    {a: /\d+/} and {a: '123'}

    {a: '123'} and {a: '123'}

    {a: {b: /\d+/}} and {a: {b: '123'}}

    {a: {b: 'wow'}} and {a: {b: 'wow'}}

Source | Google | Stack overflow

Edit

git clone [email protected]:bblimke/webmock.git

cd webmock

open lib/webmock/request_pattern.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-WebMock--BodyPattern-matching_hashes--for-pr


# Commit to git

git add lib/webmock/request_pattern.rbgit commit -m "better docs for WebMock::BodyPattern#matching_hashes?"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-WebMock--BodyPattern-matching_hashes--for-pr

hub pull-request


# Celebrate!