parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
722 stars 132 forks source link

Include request info when NotMatchError occurs #74

Closed goodgravy closed 7 years ago

goodgravy commented 8 years ago

Problem

When investigating RequestNotMatchError exceptions, it can be hard to see where the problem is. The best approach seems to be to move your cassettes to one side, re-run the test, then diff the new and old cassettes to see where the change it.

This is a pretty slow and laborious developer experience.

Solution

Include some basic information about the request which didn't match anything in the active cassette, to help the developer zero in on where the problem is.

Example message:

Request did not match with any one in the current cassette: fixture/vcr_cassettes/example_ibrowse_different.json.
Delete the current cassette with [mix vcr.delete] and re-record.

Request: ['http://example.com/different_from_original', [], :get]

If there's a better way to format the request in a human-friendly way, let me know!

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.02%) to 93.427% when pulling 412aeae9ce7f83f2da9fb35c0fbaab655e40926b on goodgravy:master into aa8d09d8c472d7d0c0d0a89fce7c625d9a237b3d on parroty:master.

parroty commented 7 years ago

Thanks! and sorry taking time to merge.