{"id":14991260,"url":"https://github.com/nebulab/reverse_coverage","last_synced_at":"2025-04-07T17:12:06.984Z","repository":{"id":36323632,"uuid":"201474222","full_name":"nebulab/reverse_coverage","owner":"nebulab","description":"A tool to find the test examples which cover a specific line (or set of lines) of a Ruby project","archived":false,"fork":false,"pushed_at":"2023-07-04T09:14:48.000Z","size":359,"stargazers_count":77,"open_issues_count":10,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-06T16:43:20.600Z","etag":null,"topics":["rspec","ruby"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/nebulab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-09T13:37:27.000Z","updated_at":"2025-01-03T13:40:59.000Z","dependencies_parsed_at":"2024-09-11T22:36:25.937Z","dependency_job_id":"1968a807-2f8b-4669-88a4-59f4b78d497f","html_url":"https://github.com/nebulab/reverse_coverage","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.4375,"last_synced_commit":"df4ca35eab1048775e974adb33c0ecfa0d6488a1"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Freverse_coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Freverse_coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Freverse_coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Freverse_coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nebulab","download_url":"https://codeload.github.com/nebulab/reverse_coverage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694877,"owners_count":20980733,"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":["rspec","ruby"],"created_at":"2024-09-24T14:22:02.493Z","updated_at":"2025-04-07T17:12:06.959Z","avatar_url":"https://github.com/nebulab.png","language":"JavaScript","readme":"[![Gem Version](https://badge.fury.io/rb/reverse_coverage.svg)](https://badge.fury.io/rb/reverse_coverage)\n\n# ReverseCoverage\n\nThe goal of this component is to find what RSpec examples \"cover\" one or more lines of code of a Ruby project.\n\nThis is useful for example when you override methods of a parent product and you want to check what/how the specs treat the original lines.\n\nBlog post introduction: [https://nebulab.it/blog/reverse-coverage/](https://nebulab.it/blog/reverse-coverage/)\n\n## Installation\n\nAdd `gem 'reverse_coverage'` to your application's Gemfile and execute `bundle`.\n\nPut the following code under you specs configuration:\n\n```ruby\nrequire 'reverse_coverage'\n\nRSpec.configure do |config|\n  config.before(:suite) do\n    ReverseCoverage::Main.start\n  end\n\n  config.around do |e|\n    e.run\n    ReverseCoverage::Main.add(e)\n  end\n\n  config.after(:suite) do\n    ReverseCoverage::Main.save_results\n    coverage_matrix = ReverseCoverage::Main.coverage_matrix\n    ReverseCoverage::Formatters::HTML::Formatter.new.format(coverage_matrix)\n  end\nend\n```\n\n## Usage\n\nRun your specs, inspect the `'tmp/reverse_coverage.yml'` file or open `'tmp/index.html'` file.\n\nTo configure the base URL used to open a specific spec edit the generated `'tmp/settings.js'` file. Without changes, the default behavior is to open files locally.\n\n## Options\n\n- `file_filter`: allows to set a lambda to filter what files belongs to the project. Example (to add before `ReverseCoverage::Main.start` line): `ReverseCoverage::Main.config[:file_filter] = -\u003e(file_path) { file_path.include? 'faked_project' }`\n\n## Testing\n\nExecute `bundle exec rspec` on the component root path, specs are based on an internal fake project.\n\n## HTML output screenshot\n\nHere it is a screenshot of the generated HTML interface:\n\n![Reverse Coverage screenshot](extra/screenshot.jpg)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nebulab/reverse_coverage. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nReverseCoverage is copyright © 2019 [Nebulab](http://nebulab.it/). It is free software, and may be redistributed under the terms specified in the [license](LICENSE.txt).\n\n## About\n\n![Nebulab](http://nebulab.it/assets/images/public/logo.svg)\n\nReverseCoverage is funded and maintained by the [Nebulab](http://nebulab.it/) team.\n\nWe firmly believe in the power of open-source. [Contact us](http://nebulab.it/contact-us/) if you like our work and you need help with your project design or development.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebulab%2Freverse_coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebulab%2Freverse_coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebulab%2Freverse_coverage/lists"}