Last active
August 29, 2015 14:01
-
-
Save mbj/6b7078242a716b68bb6d to your computer and use it in GitHub Desktop.
mutant raje tasj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On production devtools is not loaded | |
if defined?(Devtools) | |
# Load all rake tasks | |
Rake.application.load_imports | |
# Remove metrics:mutant from devtools | |
task('metrics:mutant').clear | |
namespace :metrics do | |
allowed_versions = %w[mri-1.9.3 mri-2.0.0 rbx-1.9.3] | |
if allowed_versions.include?(Devtools.rvm) | |
require 'mutant' | |
desc 'Run mutant' | |
task mutant: :coverage do | |
# Eager load application and dependencies | |
require File.expand_path('../../../config/environment', __FILE__) | |
status = Mutant::CLI.run(%w[--use rspec ::MyApp*]) | |
if status.nonzero? | |
Devtools.notify_metric_violation 'Mutant task is not successful' | |
end | |
end | |
else | |
desc 'Run Mutant' | |
task mutant: :coverage do | |
$stderr.puts 'Mutant is disabled' | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment