Sinatra Basics : Test Coverage for Sinatra Applications


To learn how to setup simplecov to generate test coverage report.


Step 1

In your Gemfilefile, add the following to the test group:

gem 'simplecov'

Step 2

$bundle install

Step 3

In spec/spec_helper.rb (before anything else)

require 'simplecov'

Step 4

$rspec spec

Step 5

To view the test coverage report.

$open coverage/index.html


In this article, you learned how to use simplecov gem to generate test coverage reports for a Sinatra application.

Related Articles

Create your own user feedback survey