a19f3b1691
* I do not use 1.9.3 * Also keeping them in each file increases mental overhead (true it *can* be autoamted) * None of the files encodes NON ASCII chars. * I do not expect it makes any difference, since nobody programmatically will consume strings generated by mutant under the assumption they are UTF-8 encoded. * 1.9.3 Users have to deal with the encoding fuckup under ruby anyways.
34 lines
838 B
Ruby
34 lines
838 B
Ruby
shared_examples_for 'a method matcher' do
|
|
|
|
before { subject }
|
|
|
|
let(:node) { mutation_subject.node }
|
|
let(:context) { mutation_subject.context }
|
|
let(:mutation_subject) { yields.first }
|
|
|
|
it 'should return one subject' do
|
|
expect(yields.size).to be(1)
|
|
end
|
|
|
|
it_should_behave_like 'an #each method'
|
|
|
|
it 'should have correct method name' do
|
|
expect(name).to eql(method_name)
|
|
end
|
|
|
|
it 'should have correct line number' do
|
|
expect(node.location.expression.line - base).to eql(method_line)
|
|
end
|
|
|
|
it 'should have correct arity' do
|
|
expect(arguments.children.length).to eql(method_arity)
|
|
end
|
|
|
|
it 'should have correct scope in context' do
|
|
expect(context.scope).to eql(scope)
|
|
end
|
|
|
|
it 'should have the correct node type' do
|
|
expect(node.type).to be(type)
|
|
end
|
|
end
|