diff --git a/lib/mutant/cli.rb b/lib/mutant/cli.rb index d731ab7e..f22a199d 100644 --- a/lib/mutant/cli.rb +++ b/lib/mutant/cli.rb @@ -102,7 +102,6 @@ module Mutant # def strategy @strategy or raise(Error, 'No strategy was set!') - @strategy.new(self) end memoize :strategy diff --git a/lib/mutant/strategy.rb b/lib/mutant/strategy.rb index 8742d295..99f1364b 100644 --- a/lib/mutant/strategy.rb +++ b/lib/mutant/strategy.rb @@ -2,7 +2,7 @@ module Mutant # Abstract base class for killing strategies class Strategy - include AbstractType, Adamantium::Flat, Concord::Public.new(:config) + include AbstractType, Adamantium::Flat # Perform setup # @@ -10,7 +10,7 @@ module Mutant # # @api private # - def setup + def self.setup self end @@ -20,7 +20,7 @@ module Mutant # # @api private # - def teardown + def self.teardown self end @@ -32,7 +32,7 @@ module Mutant # # @api private # - def kill(mutation) + def self.kill(mutation) killer.new(self, mutation) end @@ -42,8 +42,8 @@ module Mutant # # @api private # - def killer - self.class::KILLER + def self.killer + self::KILLER end end # Strategy diff --git a/lib/mutant/strategy/rspec.rb b/lib/mutant/strategy/rspec.rb index c65ffd84..ec30d57a 100644 --- a/lib/mutant/strategy/rspec.rb +++ b/lib/mutant/strategy/rspec.rb @@ -12,7 +12,7 @@ module Mutant # # @api private # - def setup + def self.setup require('./spec/spec_helper.rb') self end @@ -26,7 +26,7 @@ module Mutant # # @api private # - def spec_files(mutation) + def self.spec_files(mutation) Dir['spec/unit/**/*_spec.rb'] end end # Unit @@ -40,7 +40,7 @@ module Mutant # # @api private # - def spec_files(mutation) + def self.spec_files(mutation) Dir['spec/integration/**/*_spec.rb'] end end # Integration @@ -54,7 +54,7 @@ module Mutant # # @api private # - def spec_files(mutation) + def self.spec_files(mutation) Dir['spec/**/*_spec.rb'] end end # Full diff --git a/lib/mutant/strategy/rspec/dm2.rb b/lib/mutant/strategy/rspec/dm2.rb index 65b88f76..27f8dc31 100644 --- a/lib/mutant/strategy/rspec/dm2.rb +++ b/lib/mutant/strategy/rspec/dm2.rb @@ -12,7 +12,7 @@ module Mutant # # @api private # - def spec_files(subject) + def self.spec_files(subject) Lookup.run(subject) end diff --git a/lib/mutant/subject/method.rb b/lib/mutant/subject/method.rb index 500962ef..fae774c9 100644 --- a/lib/mutant/subject/method.rb +++ b/lib/mutant/subject/method.rb @@ -15,6 +15,16 @@ module Mutant # abstract_method :public? + # Return method name + # + # @return [Symbol] + # + # @api private + # + def name + node.children[self.class::NAME_INDEX] + end + private # Return scope @@ -27,16 +37,6 @@ module Mutant context.scope end - # Return method name - # - # @return [Symbol] - # - # @api private - # - def name - node.children[self.class::NAME_INDEX] - end - # Return subtype identifier # # @return [String] diff --git a/spec/unit/mutant/cli/class_methods/new_spec.rb b/spec/unit/mutant/cli/class_methods/new_spec.rb index 12a77593..f6d18b5f 100644 --- a/spec/unit/mutant/cli/class_methods/new_spec.rb +++ b/spec/unit/mutant/cli/class_methods/new_spec.rb @@ -8,10 +8,10 @@ end shared_examples_for 'a cli parser' do subject { cli.config } - its(:filter) { should eql(expected_filter) } - its(:strategy) { should eql(expected_strategy.new(subject)) } - its(:reporter) { should eql(expected_reporter) } - its(:matcher) { should eql(expected_matcher) } + its(:filter) { should eql(expected_filter) } + its(:strategy) { should eql(expected_strategy) } + its(:reporter) { should eql(expected_reporter) } + its(:matcher) { should eql(expected_matcher) } end describe Mutant::CLI, '.new' do