Sha256: 5f23cac7317e329e747c449c871aa5bebc6d822c88b3bc88ab86a77e1742b912

Contents?: true

Size: 823 Bytes

Versions: 17

Compression:

Stored size: 823 Bytes

Contents

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
    yields.size.should be(1)
  end

  it_should_behave_like 'an #each method'

  it 'should have correct method name' do
    name.should eql(method_name)
  end

  it 'should have correct line number' do
    (node.location.expression.line - base).should eql(method_line)
  end

  it 'should have correct arity' do
    arguments.children.length.should eql(method_arity)
  end

  it 'should have correct scope in context' do
    context.send(:scope).should eql(scope)
  end

  it 'should have the correct node type' do
    node.type.should be(type)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta20 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta19 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta18 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta17 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta16 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta15 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta14 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta13 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta12 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta11 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta10 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta9 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta8 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta7 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta6 spec/shared/method_matcher_behavior.rb
mutant-0.3.0.beta5 spec/shared/method_matcher_behavior.rb