Sha256: 296e12dd442ef765508eddceab541408d092d88354921d3417a5c7b55bf34add

Contents?: true

Size: 837 Bytes

Versions: 17

Compression:

Stored size: 837 Bytes

Contents

RSpec.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).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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mutant-0.8.1 spec/shared/method_matcher_behavior.rb
mutant-0.8.0 spec/shared/method_matcher_behavior.rb
mutant-0.7.9 spec/shared/method_matcher_behavior.rb
mutant-0.7.8 spec/shared/method_matcher_behavior.rb
mutant-0.7.7 spec/shared/method_matcher_behavior.rb
mutant-0.7.6 spec/shared/method_matcher_behavior.rb
mutant-0.7.5 spec/shared/method_matcher_behavior.rb
mutant-0.7.4 spec/shared/method_matcher_behavior.rb
mutant-0.7.3 spec/shared/method_matcher_behavior.rb
mutant-0.7.2 spec/shared/method_matcher_behavior.rb
mutant-0.7.1 spec/shared/method_matcher_behavior.rb
mutant-0.6.7 spec/shared/method_matcher_behavior.rb
mutant-0.6.6 spec/shared/method_matcher_behavior.rb
mutant-0.6.5 spec/shared/method_matcher_behavior.rb
mutant-0.6.4 spec/shared/method_matcher_behavior.rb
mutant-0.6.3 spec/shared/method_matcher_behavior.rb
mutant-0.6.2 spec/shared/method_matcher_behavior.rb