thoughtworks/pacto — pull request #134 by maxlinc (2014-07-10 22:57:13+00:00)
Title: New RSpec matcher (have_investigated)

This adds the `have_investigated` matcher, which is a more "Pacto-idiomatic" version of `have_validated`. The difference is that `have_investigated` matches contracts first, not request patterns, and has more flexibility and better error messages as you apply more and more specific filters.

E.g.:

```ruby
expect(Pacto).to have_investigated('Echo').with_request(body: hash_including('foo' => 'bar'))
expect(Pacto).to have_investigated('Echo').with_response(body: /foo.*bar/)
```

You could also write that as a single line if you want to make sure it's for the request and response on the **same** interaction:
```ruby
expect(Pacto).to have_investigated('Echo').with_request(body: hash_including('foo' => 'bar')).with_response(body: /foo.*bar/)
```

Might be possible to simplify further and provide a nice API w/ rspec3, but not sure about keeping it rspec2 compatible.