Skip to content

Commit f1699ce

Browse files
committed
Display coverage stats when developing locally
The Coveralls gem doesn't display coverage statistics directly in the console when run locally. Get around this by using SimpleCov directly when not in Travis so we get the actual coverage stats rendered in the `coverage` directory, making it quicker to write tests and see how much coverage has changed.
1 parent 10c85a9 commit f1699ce

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

spec/spec_helper.rb

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# Bootstrap code coverage instrumentation. This must happen first!
2-
require 'coveralls'
3-
Coveralls.wear!
1+
if ENV['TRAVIS']
2+
# When running in Travis, report coverage stats to Coveralls.
3+
require 'coveralls'
4+
Coveralls.wear!
5+
else
6+
# Otherwise render coverage information in coverage/index.html and display
7+
# coverage percentage in the console.
8+
require 'simplecov'
9+
end
410

511
require 'overcommit'
612
require 'tempfile'

0 commit comments

Comments
 (0)