All Projects → nebulab → reverse_coverage

nebulab / reverse_coverage

Licence: MIT License
A tool to find the test examples which cover a specific line (or set of lines) of a Ruby project

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
ruby
36898 projects - #4 most used programming language
HTML
75241 projects
Gherkin
971 projects

Labels

Projects that are alternatives of or similar to reverse coverage

turbo tests
Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
Stars: ✭ 81 (+32.79%)
Mutual labels:  rspec
Ruby Capstone
A simple web scraper built with Ruby and the Nokogiri gem. It crawls a certain website and gets the prices and other data of cryptocurrencies. Rspec was used for testing.
Stars: ✭ 14 (-77.05%)
Mutual labels:  rspec
gruf-rspec
RSpec helper suite for gruf
Stars: ✭ 19 (-68.85%)
Mutual labels:  rspec
database plumber
Find leaky ActiveRecord models in your RSpec tests
Stars: ✭ 13 (-78.69%)
Mutual labels:  rspec
wisper-rspec
RSpec matchers and stubbing for Wisper
Stars: ✭ 59 (-3.28%)
Mutual labels:  rspec
rspec.tmbundle
Textmate bundle for RSpec.
Stars: ✭ 196 (+221.31%)
Mutual labels:  rspec
rspec-tap-formatters
TAP Producer for RSpec-3
Stars: ✭ 20 (-67.21%)
Mutual labels:  rspec
knapsack pro-ruby
Knapsack Pro gem splits tests across parallel CI nodes and makes sure that tests will run in optimal time on each node.
Stars: ✭ 101 (+65.57%)
Mutual labels:  rspec
fixturama
Collection of helpers for dealing with fixtures in RSpec
Stars: ✭ 33 (-45.9%)
Mutual labels:  rspec
rspec-json matchers
A collection of RSpec matchers for testing JSON data.
Stars: ✭ 23 (-62.3%)
Mutual labels:  rspec
givens
Easy test setup without side effects.
Stars: ✭ 22 (-63.93%)
Mutual labels:  rspec
ginkgo4j
A Java BDD Testing Framework (based on RSpec and Ginkgo)
Stars: ✭ 25 (-59.02%)
Mutual labels:  rspec
allure-ruby
Allure integrations for Ruby test frameworks
Stars: ✭ 40 (-34.43%)
Mutual labels:  rspec
mache
A library for writing cleaner and more expressive acceptance tests using page objects.
Stars: ✭ 40 (-34.43%)
Mutual labels:  rspec
souls
SOULs 🔥 Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
Stars: ✭ 327 (+436.07%)
Mutual labels:  rspec
saharspec
RSpec sugar to DRY your specs
Stars: ✭ 58 (-4.92%)
Mutual labels:  rspec
capybara select2
Capybara helpers for https://select2.org select box (supports Select2 version 2/3/4)
Stars: ✭ 48 (-21.31%)
Mutual labels:  rspec
rspec n
A ruby gem that runs RSpec N times.
Stars: ✭ 37 (-39.34%)
Mutual labels:  rspec
CtCI-with-Ruby-TDD
Cracking the Coding Interview with Ruby and TDD
Stars: ✭ 44 (-27.87%)
Mutual labels:  rspec
rspec-hanami
RSpec Matchers for Hanami
Stars: ✭ 47 (-22.95%)
Mutual labels:  rspec

Gem Version

ReverseCoverage

The goal of this component is to find what RSpec examples "cover" one or more lines of code of a Ruby project.

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

Blog post introduction: https://nebulab.it/blog/reverse-coverage/

Installation

Add gem 'reverse_coverage' to your application's Gemfile and execute bundle.

Put the following code under you specs configuration:

require 'reverse_coverage'

RSpec.configure do |config|
  config.before(:suite) do
    ReverseCoverage::Main.start
  end

  config.around do |e|
    e.run
    ReverseCoverage::Main.add(e)
  end

  config.after(:suite) do
    ReverseCoverage::Main.save_results
    coverage_matrix = ReverseCoverage::Main.coverage_matrix
    ReverseCoverage::Formatters::HTML::Formatter.new.format(coverage_matrix)
  end
end

Usage

Run your specs, inspect the 'tmp/reverse_coverage.yml' file or open 'tmp/index.html' file.

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

Options

  • 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] = ->(file_path) { file_path.include? 'faked_project' }

Testing

Execute bundle exec rspec on the component root path, specs are based on an internal fake project.

HTML output screenshot

Here it is a screenshot of the generated HTML interface:

Reverse Coverage screenshot

Contributing

Bug 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 code of conduct.

License

ReverseCoverage is copyright © 2019 Nebulab. It is free software, and may be redistributed under the terms specified in the license.

About

Nebulab

ReverseCoverage is funded and maintained by the Nebulab team.

We firmly believe in the power of open-source. Contact us if you like our work and you need help with your project design or development.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].