49 lines
1.2 KiB
Ruby
49 lines
1.2 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe Mutant::Runner::Subject, '#success?' do
|
|
subject { object.success? }
|
|
|
|
let(:object) { described_class.run(config, mutation_subject) }
|
|
|
|
let(:reporter) { double('Reporter') }
|
|
let(:mutation_subject) { double('Subject', :map => mutations) }
|
|
let(:config) { double('Config', :reporter => reporter) }
|
|
let(:mutation_a) { double('Mutation A', :failed? => false) }
|
|
let(:mutation_b) { double('Mutation B', :failed? => false) }
|
|
let(:mutations) { [mutation_a, mutation_b] }
|
|
|
|
before do
|
|
reporter.stub(:report => reporter)
|
|
end
|
|
|
|
class DummyMutationRunner
|
|
include Concord::Public.new(:config, :mutation)
|
|
|
|
def self.run(*args)
|
|
new(*args)
|
|
end
|
|
|
|
def failed?
|
|
@mutation.failed?
|
|
end
|
|
end
|
|
|
|
before do
|
|
stub_const('Mutant::Runner::Mutation', DummyMutationRunner)
|
|
end
|
|
|
|
context 'without evil failed mutations' do
|
|
it { should be(true) }
|
|
end
|
|
|
|
context 'with failing noop mutation' do
|
|
end
|
|
|
|
context 'with failing evil mutations' do
|
|
before do
|
|
mutation_a.stub(:failed? => true)
|
|
end
|
|
|
|
it { should be(false) }
|
|
end
|
|
end
|