{"id":15203150,"url":"https://github.com/tylerrick/rspec-on_failure","last_synced_at":"2026-02-03T04:03:39.932Z","repository":{"id":56892934,"uuid":"144246104","full_name":"TylerRick/rspec-on_failure","owner":"TylerRick","description":"Provide additional debugging information to be printed if a test fails.","archived":false,"fork":false,"pushed_at":"2019-10-22T20:40:06.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T10:17:33.418Z","etag":null,"topics":["debugging-tool","rspec","testing"],"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/TylerRick.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-10T06:29:46.000Z","updated_at":"2019-10-22T20:40:04.000Z","dependencies_parsed_at":"2022-08-21T01:50:12.599Z","dependency_job_id":null,"html_url":"https://github.com/TylerRick/rspec-on_failure","commit_stats":null,"previous_names":["tylerrick/rspec_on_failure"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/TylerRick/rspec-on_failure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Frspec-on_failure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Frspec-on_failure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Frspec-on_failure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Frspec-on_failure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TylerRick","download_url":"https://codeload.github.com/TylerRick/rspec-on_failure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Frspec-on_failure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261064524,"owners_count":23104727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["debugging-tool","rspec","testing"],"created_at":"2024-09-28T04:41:26.934Z","updated_at":"2026-02-03T04:03:34.890Z","avatar_url":"https://github.com/TylerRick.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSpecOnFailure\n\nProvide additional debugging information to be printed if a test fails.\n\nIn case the debugging information you want to display on failure cannot be easily determined *prior*\nto evaluating the expectation. This won't work as expected, for example:\n\n```ruby\nexpect(user).to be_valid, user.errors.full_messages\n```\n\nbecause `user.errors.full_messages` gets evaluated too soon. This will show the list of errors as it\nwas *prior* to calling `user.valid?` (that is, an empty array), rather than the list of errors as it\nwas *after* validating therecord, which is what we actually want.\n\nInstead, you can do this, which defers evaluation of the debug information until the time of the\nfailure:\n\n```ruby\n   on_failure -\u003e{ user.errors.full_messages } do\n     expect(user).to be_valid\n   end\n```\n\nIf no block is given, the provided on_failure proc remains in effect until the end of the current\nexample.\n\n```ruby\n   on_failure -\u003e{ user.errors.full_messages }\n   expect(user).to be_valid\n   expect(user.errors[:name]).to include \"is required\"\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngroup :test do\n  gem 'rspec-on_failure'\nend\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/TylerRick/rspec-on_failure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerrick%2Frspec-on_failure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylerrick%2Frspec-on_failure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerrick%2Frspec-on_failure/lists"}