From f58696a06361b536a5aa05a2d78cc054e71636ca Mon Sep 17 00:00:00 2001 From: yafeilee Date: Thu, 17 Jul 2014 21:04:53 +0800 Subject: [PATCH] add code climdate test coverage --- .travis.yml | 2 ++ Gemfile | 1 + README.md | 1 + spec/spec_helper.rb | 2 ++ 4 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index bf3e229..bc49883 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ language: ruby bundler_args: '--without production' +script: CODECLIMATE_REPO_TOKEN=7d6b988f58234bf1560305412d10d9530902beebdbe2fb938b6a934f1d352578 bundle exec rake + before_install: - "cat /etc/timezone" - "grep -i processor /proc/cpuinfo | wc -l" diff --git a/Gemfile b/Gemfile index c7ed4f4..9f89c90 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,7 @@ group :test do gem 'mongoid-rspec', :require => false gem 'database_cleaner' gem 'rspec-sidekiq' + gem "codeclimate-test-reporter", group: :test, require: nil end group :test, :development do diff --git a/README.md b/README.md index a74b373..259cc71 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ WBlog ======= [![Build Status](https://travis-ci.org/windy/wblog.svg?branch=master)](https://travis-ci.org/windy/wblog) [![Code Climate](https://codeclimate.com/github/windy/wblog.png)](https://codeclimate.com/github/windy/wblog) +[![Test Coverage](https://codeclimate.com/github/windy/wblog/coverage.png)](https://codeclimate.com/github/windy/wblog) 为移动而生的 Ruby on Rails 开源博客. WBlog 基于 MIT 协议, 自由使用. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 05bbcdb..c82b917 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,7 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' +require "codeclimate-test-reporter" +CodeClimate::TestReporter.start require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun'