Skip to content

Commit 69e06f7

Browse files
author
David Davis
committed
Setup simplecov in katello
1 parent 9a165d5 commit 69e06f7

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

.simplecov

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# .simplecov
2+
SimpleCov.start 'rails' do
3+
# configuration stuff
4+
merge_timeout 1800
5+
command_name "spec"
6+
command_name "minitest"
7+
add_filter "/test/"
8+
add_filter "/lib/tasks/"
9+
add_filter "/spec"
10+
end if ENV['COVERAGE']

bundler.d/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
gem 'webmock'
1515
gem 'minitest', '<=4.5.0', :require => "hoe/minitest"
1616
gem 'minitest-rails'
17-
gem 'mocha', :require=>false
17+
gem 'mocha', '~> 0.13.1', :require=>false
1818
# make our specs go faster (also appears in development group)
1919
gem "parallel_tests"
2020
end

lib/tasks/simplecov.rake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if RUBY_VERSION >= "1.9"
2+
require 'simplecov'
3+
4+
task :simplecov do
5+
ENV['COVERAGE'] = 'true'
6+
Rake::Task["minitest"].execute
7+
Rake::Task["spec"].execute
8+
end
9+
end

spec/spec_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
# This file is copied to spec/ when you run 'rails generate rspec:install'
1616
ENV["RAILS_ENV"] ||= 'test'
17+
if RUBY_VERSION >= "1.9"
18+
require 'simplecov'
19+
end
1720
require File.expand_path("../../config/environment", __FILE__)
1821
require 'rspec/rails'
1922
require 'webrat'

test/minitest_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
ENV["RAILS_ENV"] = "test"
22

3+
if RUBY_VERSION >= "1.9"
4+
require 'simplecov'
5+
end
36
require File.expand_path('../../config/environment', __FILE__)
47
require 'minitest/autorun'
58
require 'minitest/rails'

0 commit comments

Comments
 (0)