free_mutant/spec/unit/mutant/result/subject_spec.rb
Markus Schirp 207c159c23 Always build valid result objects
* Before Mutant::Expression was not marshallable resulting in the need
  to build "partial" result objects from killforks.
* Fixes an adjacent bug in spec selection
2014-12-22 17:54:20 +00:00

44 lines
1 KiB
Ruby

RSpec.describe Mutant::Result::Subject do
let(:object) do
described_class.new(
subject: mutation_subject,
mutation_results: mutation_results,
tests: []
)
end
let(:mutation_subject) { double('Subject') }
describe '#continue?' do
subject { object.continue? }
context 'when mutation results are empty' do
let(:mutation_results) { [] }
it { should be(true) }
end
context 'with failing mutation result' do
let(:mutation_results) { [double('Mutation Result', success?: false)] }
it { should be(false) }
end
context 'with successful mutation result' do
let(:mutation_results) { [double('Mutation Result', success?: true)] }
it { should be(true) }
end
context 'with failed and successful mutation result' do
let(:mutation_results) do
[
double('Mutation Result', success?: true),
double('Mutation Result', success?: false)
]
end
it { should be(false) }
end
end
end