ApprovalTests.Ruby
ApprovalTests.Ruby copied to clipboard
diff preview
Approvals::ApprovalError:
Approval Error: Received file does not match approved:
spec/fixtures/approvals/ampcontroller/renders_article.received.html
spec/fixtures/approvals/ampcontroller/renders_article.approved.html
approved fragment: uper-bowl-opening-night-2016-best-moments
received fragment: uper-bowl-ening-night-2016-best-moments-a
Gives instant idea of what could be wrong. Plus indispensable, when approval error happens on external isolated environment like Travis or Circle-ci.
@garmoshka-mo Hi! I've volunteered to help out with maintaining this gem. It's going to take me a while to get up to speed enough to decide what to do with this PR, but I can at least start out by asking: is this still something you want to see in the approvals gem?
If so, I might look for a way we can make this pluggable, because various kinds of data (XML, HTML, JSON, CSV, plain text, etc) might each benefit from their own way of presenting diffs.
For example, I see that the CLI takes a -d
flag that allows you to specify a diff command to be used, but the implementation is currently locked up in the CLI implementation, so that feature isn't really available if you're using approvals from RSpec. If I can refactor the code to make "diff presentation" a first-class concept in the rest of the gem, that might benefit a wider variety of use cases...
Hi @geeksam it was pretty long time ago, I don't work anymore on project where I used this library
@garmoshka-mo thanks! Thought that might be the case. I'll leave this open as a reminder to think about diffing at some point, though. :)