Fix coverage for Mutant::Subject* namespace
This commit is contained in:
parent
690fcfdab0
commit
e185f2a938
4 changed files with 8 additions and 9 deletions
|
@ -9,11 +9,11 @@ module Mutant
|
|||
# @return [Enumerable<Mutation>]
|
||||
# @return [undefined]
|
||||
def mutations
|
||||
mutations = [neutral_mutation]
|
||||
Mutator.each(node) do |mutant|
|
||||
mutations << Mutation::Evil.new(self, wrap_node(mutant))
|
||||
end
|
||||
mutations
|
||||
[neutral_mutation].concat(
|
||||
Mutator.each(node).map do |mutant|
|
||||
Mutation::Evil.new(self, wrap_node(mutant))
|
||||
end
|
||||
)
|
||||
end
|
||||
memoize :mutations
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@ module Mutant
|
|||
# @return [self]
|
||||
def prepare
|
||||
scope.__send__(:memoized_methods).instance_variable_get(:@memory).delete(name)
|
||||
super
|
||||
self
|
||||
super()
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -103,7 +103,7 @@ RSpec.describe Mutant::Subject::Method::Instance::Memoized do
|
|||
it_should_behave_like 'a command method'
|
||||
end
|
||||
|
||||
describe '#mutations' do
|
||||
describe '#mutations', mutant_expression: 'Mutant::Subject#mutations' do
|
||||
subject { object.mutations }
|
||||
|
||||
let(:expected) do
|
||||
|
|
|
@ -71,7 +71,7 @@ RSpec.describe Mutant::Subject do
|
|||
subject { object.mutations }
|
||||
|
||||
before do
|
||||
expect(Mutant::Mutator).to receive(:each).with(node).and_yield(mutation_a).and_yield(mutation_b)
|
||||
expect(Mutant::Mutator).to receive(:each).with(node).and_return([mutation_a, mutation_b])
|
||||
end
|
||||
|
||||
let(:mutation_a) { double('Mutation A') }
|
||||
|
|
Loading…
Add table
Reference in a new issue