Sha256: 8646e00e82d2507037e33c492d4913fd9d736f82ee317f596eddc4edc88e806a

Contents?: true

Size: 857 Bytes

Versions: 20

Compression:

Stored size: 857 Bytes

Contents

# encoding: utf-8

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mutant-0.5.19 spec/shared/method_matcher_behavior.rb
mutant-0.5.18 spec/shared/method_matcher_behavior.rb
mutant-0.5.17 spec/shared/method_matcher_behavior.rb
mutant-0.5.16 spec/shared/method_matcher_behavior.rb
mutant-0.5.15 spec/shared/method_matcher_behavior.rb
mutant-0.5.14 spec/shared/method_matcher_behavior.rb
mutant-0.5.13 spec/shared/method_matcher_behavior.rb
mutant-0.5.12 spec/shared/method_matcher_behavior.rb
mutant-0.5.11 spec/shared/method_matcher_behavior.rb
mutant-0.5.10 spec/shared/method_matcher_behavior.rb
mutant-0.5.9 spec/shared/method_matcher_behavior.rb
mutant-0.5.8 spec/shared/method_matcher_behavior.rb
mutant-0.5.7 spec/shared/method_matcher_behavior.rb
mutant-0.5.6 spec/shared/method_matcher_behavior.rb
mutant-0.5.5 spec/shared/method_matcher_behavior.rb
mutant-0.5.4 spec/shared/method_matcher_behavior.rb
mutant-0.5.3 spec/shared/method_matcher_behavior.rb
mutant-0.5.2 spec/shared/method_matcher_behavior.rb
mutant-0.5.1 spec/shared/method_matcher_behavior.rb
mutant-0.5.0 spec/shared/method_matcher_behavior.rb