{"id":15288747,"url":"https://github.com/ang3lkar/pretty-diffs","last_synced_at":"2026-03-08T16:34:32.032Z","repository":{"id":56888748,"uuid":"70487339","full_name":"ang3lkar/pretty-diffs","owner":"ang3lkar","description":"Enable fancy colored diffs in your minitest assertions","archived":false,"fork":false,"pushed_at":"2017-12-14T17:17:51.000Z","size":439,"stargazers_count":36,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-14T23:16:13.517Z","etag":null,"topics":["assertions","diff","minitest","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ang3lkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-10T12:52:25.000Z","updated_at":"2026-02-10T19:27:07.000Z","dependencies_parsed_at":"2022-08-20T16:00:14.855Z","dependency_job_id":null,"html_url":"https://github.com/ang3lkar/pretty-diffs","commit_stats":null,"previous_names":["angelkar/pretty-diffs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ang3lkar/pretty-diffs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ang3lkar%2Fpretty-diffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ang3lkar%2Fpretty-diffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ang3lkar%2Fpretty-diffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ang3lkar%2Fpretty-diffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ang3lkar","download_url":"https://codeload.github.com/ang3lkar/pretty-diffs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ang3lkar%2Fpretty-diffs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29569994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T04:18:28.490Z","status":"ssl_error","status_checked_at":"2026-02-18T04:13:49.018Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertions","diff","minitest","rails","ruby"],"created_at":"2024-09-30T15:53:02.984Z","updated_at":"2026-02-18T06:00:52.812Z","avatar_url":"https://github.com/ang3lkar.png","language":"Ruby","readme":"# PrettyDiffs\n\nA small gem to lubricate your testing workflow with prettier than usual diffs.\n\n## Motivation\nWhen you make assertions between large strings with Minitest, for example JSON responses, it is laborious to identify what has changed. The usual workflow involves copy-pasting the output into a diff tool; a rather boring and time-consuming process.\n\nMinitest chooses to compare strings using `diff`, which is line-oriented. However, 99% of the time, we do not intend to compare lines, we want just the words.\n\nPrettyDiffs is a tool that supports this desire by overriding the default Minitest method, and relieves our workflow.\n\n## Screenshots\n### Default Diff output\n![before](./images/before.png)\n\n### Diff output using PrettyDiffs\n![after](./images/after.png)\n\n## Installation\n\n### Install [wdiff](https://www.gnu.org/software/wdiff/) on your system:\nWdiff is a wrapper around diff,  it works by creating two temporary files, one word per line, and then executes diff on these files. It collects the diff output and uses it to produce a nicer display of word differences between the original files.\n\n```\n# mac\n$ brew install wdiff \n\n# linux\n$ apt get-install wdiff \n```\n\n### Install the PrettyDiffs module:\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngroup :test do\n  gem 'pretty-diffs'\nend\n```\n\nAnd then execute:\n\n```\n$ bundle\n```\n\nOr install it yourself as:\n\n```\n$ gem install pretty-diffs\n```\n\n## How to use\nInclude the module in the Minitest classes to trigger the pretty diffs:\n\n```ruby\nrequire 'pretty_diffs'\n\nmodule ActiveSupport\n\u2028  class TestCase\n    include PrettyDiffs # add this line\n\n  end\nend\n```\n\n### Get the previous output back!\nIn this rare case, set the following ENV variable:\n\n```\nMINITEST_PLAIN_BORING_DIFF='yes'\n```\n\n## Tests\n```sh\n$ rake\n```\n\n## Tasks for version 1.1.0\n* Pure JSON output instead of Hash when comparing JSON responses in controller tests, so to copy-paste directly.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Angelos Karagkiozidis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fang3lkar%2Fpretty-diffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fang3lkar%2Fpretty-diffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fang3lkar%2Fpretty-diffs/lists"}