Cleanup killers and add executable to gemspec
This commit is contained in:
parent
63322ebfdc
commit
86acb3a409
6 changed files with 30 additions and 33 deletions
|
@ -12,6 +12,7 @@ require 'ice_nine'
|
||||||
require 'ice_nine/core_ext/object'
|
require 'ice_nine/core_ext/object'
|
||||||
require 'diff/lcs'
|
require 'diff/lcs'
|
||||||
require 'diff/lcs/hunk'
|
require 'diff/lcs/hunk'
|
||||||
|
require 'rspec'
|
||||||
|
|
||||||
# Library namespace
|
# Library namespace
|
||||||
module Mutant
|
module Mutant
|
||||||
|
|
|
@ -1,38 +1,39 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Killer
|
class Killer
|
||||||
|
|
||||||
# class Forked < self
|
class Forked < self
|
||||||
# def initialize(killer, mutation)
|
def initialize(killer, mutation)
|
||||||
# @killer = killer
|
@killer = killer
|
||||||
# super(mutation)
|
super(mutation)
|
||||||
# end
|
end
|
||||||
|
|
||||||
# def type
|
def type
|
||||||
# @killer.type
|
@killer.type
|
||||||
# end
|
end
|
||||||
|
|
||||||
# def run
|
def run
|
||||||
# fork do
|
fork do
|
||||||
# @killer.new(@mutation)
|
@killer.new(@mutation)
|
||||||
# end
|
end
|
||||||
|
|
||||||
# status = Process.wait2.last
|
status = Process.wait2.last
|
||||||
# status.exitstatus.zero?
|
status.exitstatus.zero?
|
||||||
# end
|
end
|
||||||
# end
|
end
|
||||||
|
|
||||||
# class Forking < self
|
class Forking < self
|
||||||
# include Equalizer.new(:killer)
|
include Equalizer.new(:killer)
|
||||||
|
|
||||||
# attr_reader :killer
|
attr_reader :killer
|
||||||
|
|
||||||
# def initialize(strategy)
|
def initialize(strategy)
|
||||||
# @killer = killer
|
@killer = killer
|
||||||
# end
|
end
|
||||||
|
|
||||||
|
def new(mutation)
|
||||||
|
Forked.new(@killer, mutation)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# def run(mutation)
|
|
||||||
# Forked.new(@killer, mutation)
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -62,12 +62,7 @@ module Mutant
|
||||||
# @api private
|
# @api private
|
||||||
#
|
#
|
||||||
def run_rspec
|
def run_rspec
|
||||||
require 'rspec'
|
|
||||||
self.class.nest do
|
self.class.nest do
|
||||||
require './spec/spec_helper.rb'
|
|
||||||
if RSpec.world.shared_example_groups.empty?
|
|
||||||
Dir['spec/{support,shared}/**/*.rb'].each { |f| load(f) }
|
|
||||||
end
|
|
||||||
::RSpec::Core::Runner.run(command_line_arguments, @error_stream, @output_stream)
|
::RSpec::Core::Runner.run(command_line_arguments, @error_stream, @output_stream)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Mutant
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.killer
|
def self.killer
|
||||||
self::KILLER
|
Killer::Forking.new(self::KILLER)
|
||||||
end
|
end
|
||||||
|
|
||||||
class Rspec < self
|
class Rspec < self
|
||||||
|
|
1
mutant
1
mutant
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
require 'mutant'
|
require 'mutant'
|
||||||
require 'mutant/cli'
|
|
||||||
|
|
||||||
namespace =
|
namespace =
|
||||||
if File.basename($0) == 'zombie'
|
if File.basename($0) == 'zombie'
|
||||||
|
|
|
@ -13,6 +13,7 @@ Gem::Specification.new do |gem|
|
||||||
gem.files = `git ls-files`.split("\n")
|
gem.files = `git ls-files`.split("\n")
|
||||||
gem.test_files = `git ls-files -- spec`.split("\n")
|
gem.test_files = `git ls-files -- spec`.split("\n")
|
||||||
gem.extra_rdoc_files = %w[TODO]
|
gem.extra_rdoc_files = %w[TODO]
|
||||||
|
gem.executable = [ 'mutant' ]
|
||||||
|
|
||||||
gem.add_runtime_dependency('to_source', '~> 0.1.3')
|
gem.add_runtime_dependency('to_source', '~> 0.1.3')
|
||||||
gem.add_runtime_dependency('ice_nine', '~> 0.5.0')
|
gem.add_runtime_dependency('ice_nine', '~> 0.5.0')
|
||||||
|
|
Loading…
Reference in a new issue