Fix code to no longer reference a non-existant method in subject
This commit is contained in:
parent
ddec012680
commit
92cb508c6e
3 changed files with 8 additions and 32 deletions
|
@ -68,7 +68,7 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def run
|
||||
@mutations = subject.mutations.map do |mutation|
|
||||
@mutations = subject.map do |mutation|
|
||||
Mutation.run(config, mutation)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Mutant::Runner::Subject, '#mutations' do
|
||||
let(:object) { described_class.run(config, mutation_subject) }
|
||||
|
||||
subject { object.mutations }
|
||||
|
||||
let(:config) { mock('Config') }
|
||||
let(:mutation) { mock('Mutation') }
|
||||
let(:mutation_subject) { mock('Subject', :mutations => [mutation]) }
|
||||
|
||||
class DummyRunner
|
||||
include Concord.new(:config, :mutation)
|
||||
def self.run(*args); new(*args); end
|
||||
end
|
||||
|
||||
before do
|
||||
stub_const('Mutant::Runner::Mutation', DummyRunner)
|
||||
end
|
||||
|
||||
it { should eql([DummyRunner.new(config, mutation)]) }
|
||||
|
||||
it_should_behave_like 'an idempotent method'
|
||||
end
|
|
@ -5,11 +5,11 @@ describe Mutant::Runner::Subject, '#success?' do
|
|||
|
||||
let(:object) { described_class.run(config, mutation_subject) }
|
||||
|
||||
let(:mutation_subject) { mock('Subject', :mutations => mutations) }
|
||||
let(:config) { mock('Config') }
|
||||
let(:mutation_a) { mock('Mutation A', :fails? => false) }
|
||||
let(:mutation_b) { mock('Mutation B', :fails? => false) }
|
||||
let(:mutations) { [mutation_a, mutation_b] }
|
||||
let(:mutation_subject) { mock('Subject', :map => mutations) }
|
||||
let(:config) { mock('Config') }
|
||||
let(:mutation_a) { mock('Mutation A', :failed? => false) }
|
||||
let(:mutation_b) { mock('Mutation B', :failed? => false) }
|
||||
let(:mutations) { [mutation_a, mutation_b] }
|
||||
|
||||
class DummyMutationRunner
|
||||
include Concord.new(:config, :mutation)
|
||||
|
@ -19,7 +19,7 @@ describe Mutant::Runner::Subject, '#success?' do
|
|||
end
|
||||
|
||||
def failed?
|
||||
@mutation.fails?
|
||||
@mutation.failed?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe Mutant::Runner::Subject, '#success?' do
|
|||
|
||||
context 'with failing evil mutations' do
|
||||
before do
|
||||
mutation_a.stub(:fails? => true)
|
||||
mutation_a.stub(:failed? => true)
|
||||
end
|
||||
|
||||
it { should be(false) }
|
||||
|
|
Loading…
Add table
Reference in a new issue