ApprovalTests.Ruby icon indicating copy to clipboard operation
ApprovalTests.Ruby copied to clipboard

diff preview

Open garmoshka-mo opened this issue 7 years ago • 3 comments

 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 avatar Mar 17 '17 14:03 garmoshka-mo

@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...

geeksam avatar May 28 '21 23:05 geeksam

Hi @geeksam it was pretty long time ago, I don't work anymore on project where I used this library

garmoshka-mo avatar May 29 '21 11:05 garmoshka-mo

@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. :)

geeksam avatar Jun 04 '21 16:06 geeksam