Skip to content

Commit

Permalink
Merge 37fd756 into 286274a
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Apr 14, 2014
2 parents 286274a + 37fd756 commit 64a8325
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ group :development do
gem 'guard'
gem 'guard-bundler'
gem 'guard-rspec'
gem 'mutant', '~> 0.5.10'
gem 'mutant-rspec', '~> 0.5.10'
end
gem 'pry'
end
Expand Down
20 changes: 20 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,23 @@ rescue LoadError
end

task :default => [:spec, :rubocop]

task :mutant => :spec do
require 'mutant'

ignores = [
# Mutation with infinite runtime
'Naught::NullClassBuilder::Commands::Pebble#call'
]

arguments = []
arguments << '--include' << 'lib'
arguments << '--require' << 'naught'
arguments << '--use' << 'rspec'
arguments << '--score' << '87.02'
arguments << 'Naught*'
ignores.each do |ignore|
arguments << '--ignore-subject' << ignore
end
fail unless Mutant::CLI.run(arguments)
end
32 changes: 30 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,37 @@
require 'coveralls'
Coveralls.wear!
else
require 'simplecov'
SimpleCov.start
# require 'simplecov'
# SimpleCov.start
end

require 'naught'
Dir[File.join(GEM_ROOT, 'spec', 'support', '**/*.rb')].each { |f| require f }

require 'mutant'
require 'mutant-rspec'

# Monkeypatch to mutant all specs per mutation.
#
# TODO: Use master once it supports configurable implicit coverage.
#
# Morpher predicates are needed to finally make this configurable in mutant.
#
module Mutant

module Rspec
class Killer

# Return all example groups
#
# @return [Enumerable<RSpec::Example>]
#
# @api private
#
def example_groups
strategy.example_groups
end

end # Rspec
end # Killer
end # Mutant

0 comments on commit 64a8325

Please sign in to comment.