Skip to content

Commit

Permalink
Setup simplecov in katello
Browse files Browse the repository at this point in the history
  • Loading branch information
David Davis committed Mar 5, 2013
1 parent 9a165d5 commit 69e06f7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .simplecov
SimpleCov.start 'rails' do
# configuration stuff
merge_timeout 1800
command_name "spec"
command_name "minitest"
add_filter "/test/"
add_filter "/lib/tasks/"
add_filter "/spec"
end if ENV['COVERAGE']
2 changes: 1 addition & 1 deletion bundler.d/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
gem 'webmock'
gem 'minitest', '<=4.5.0', :require => "hoe/minitest"
gem 'minitest-rails'
gem 'mocha', :require=>false
gem 'mocha', '~> 0.13.1', :require=>false
# make our specs go faster (also appears in development group)
gem "parallel_tests"
end
9 changes: 9 additions & 0 deletions lib/tasks/simplecov.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if RUBY_VERSION >= "1.9"
require 'simplecov'

task :simplecov do
ENV['COVERAGE'] = 'true'
Rake::Task["minitest"].execute
Rake::Task["spec"].execute
end
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
if RUBY_VERSION >= "1.9"
require 'simplecov'
end
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'webrat'
Expand Down
3 changes: 3 additions & 0 deletions test/minitest_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ENV["RAILS_ENV"] = "test"

if RUBY_VERSION >= "1.9"
require 'simplecov'
end
require File.expand_path('../../config/environment', __FILE__)
require 'minitest/autorun'
require 'minitest/rails'
Expand Down

0 comments on commit 69e06f7

Please sign in to comment.