Skip to content

Commit 32f8d5d

Browse files
test: add coverage (#390)
1 parent 7066a9f commit 32f8d5d

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ jobs:
1414
script: commitlint-travis
1515
- stage: Tests
1616
language: ruby
17-
before_install: gem install bundler -v '1.17.3'
1817
rvm: 2.3.4
1918
script:
2019
- RAILS_ENV=test bundle exec rake test
2120
- RAILS_ENV=test bundle exec rake db:migrate && bundle exec rspec --color --format doc
21+
# NOTICE: Handles code coverage reporting to Code Climate
22+
before_install:
23+
- gem install bundler -v '1.17.3'
24+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
25+
- chmod +x ./cc-test-reporter
26+
after_script:
27+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
2228
- stage: Build & Publish
2329
if: branch IN ("master", "beta") AND type != pull_request
2430
language: node_js

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ end
1919
group :test do
2020
gem 'rake'
2121
gem 'sqlite3', '1.3.13'
22+
gem 'simplecov', require: false
2223
end
2324

2425
gem 'rails', '4.2.7.1'

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ GEM
6363
concurrent-ruby (1.1.5)
6464
crass (1.0.6)
6565
diff-lcs (1.3)
66+
docile (1.3.2)
6667
erubis (2.7.0)
6768
globalid (0.4.1)
6869
activesupport (>= 4.2.0)
@@ -136,6 +137,11 @@ GEM
136137
rspec-mocks (~> 3.8.0)
137138
rspec-support (~> 3.8.0)
138139
rspec-support (3.8.0)
140+
simplecov (0.17.1)
141+
docile (~> 1.1)
142+
json (>= 1.8, < 3)
143+
simplecov-html (~> 0.10.0)
144+
simplecov-html (0.10.2)
139145
sprockets (3.7.2)
140146
concurrent-ruby (~> 1.0)
141147
rack (> 1, < 3)
@@ -169,6 +175,7 @@ DEPENDENCIES
169175
rake
170176
rotp (= 3.1)
171177
rspec-rails (= 3.8.2)
178+
simplecov
172179
sqlite3 (= 1.3.13)
173180
useragent
174181

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
12
# Forest Admin in Rails
23
[![Gem](https://badge.fury.io/rb/forest_liana.svg)](https://badge.fury.io/rb/forest_liana)
3-
[![CI status](https://travis-ci.org/ForestAdmin/forest-rails.svg?branch=devel)](https://travis-ci.org/ForestAdmin/forest-rails)
4+
[![CI status](https://travis-ci.org/ForestAdmin/forest-rails.svg?branch=master)](https://travis-ci.org/ForestAdmin/forest-rails)
5+
[![Test Coverage](https://api.codeclimate.com/v1/badges/959c02b420b455eac51f/test_coverage)](https://codeclimate.com/github/ForestAdmin/forest-rails/test_coverage)
46
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
57

68
Forest Admin provides an off-the-shelf administration panel based on a highly-extensible API plugged into your application.

spec/spec_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
require 'simplecov'
2+
SimpleCov.start 'rails'
3+
14
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
25
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
36
# The generated `.rspec` file contains `--require spec_helper` which will cause

0 commit comments

Comments
 (0)