Travis CI Ruby Test Coverage

  1. Add the codeclimate-test-reporter and simplecov gems to your Gemfile:
group :test do
  gem "simplecov"
  gem "codeclimate-test-reporter", "~> 1.0.0"
end
  1. Start SimpleCov at the very top of your test/test_helper.rb, spec/spec_helper.rb, or Cucumber env.rb file:
require "simplecov"
SimpleCov.start
  1. Configure your .travis.yml file to use Code Climate
addons:
  code_climate:
    repo_token: <token>
# regular test configuration
after_success:
  - bundle exec codeclimate-test-reporter

You can find your repo's token on your repo's settings page

Make sure that "Build pushes" is enabled on your repo settings page.

Travis CI Ruby Test Coverage