Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 876 Bytes

File metadata and controls

45 lines (30 loc) · 876 Bytes

RSpec CircleCI Coverage

A RSpec plugin that generates coverage data for CircleCI's Smarter Testing.

Usage

Add the plugin to the Gemfile:

gem 'rspec-circleci-coverage', :github => 'circleci/rspec-circleci-coverage'

Install the plugin:

bundle install

Add the plugin to your spec_helper.rb

require "rspec-circleci-coverage"

To generate coverage, set the CIRCLECI_COVERAGE environment variable:

CIRCLECI_COVERAGE=coverage.json bundle exec rspec

Development

Run the integration tests:

bundle install
bundle exec rspec

Generate the testsuite integration test:

circleci run testsuite 'integration test' --local --test-analysis=all && cat coverage.json | jq --sort-keys > coveragetmp.json && mv coveragetmp.json coverage.json