Sha256: 070380a591b43ecad7c360735dea24b76ee0abfff78d1f0f2ae9a64a7863ce8f

Contents?: true

Size: 653 Bytes

Versions: 9

Compression:

Stored size: 653 Bytes

Contents

RSpec.describe Mutant::Matcher::Filter, '#call' do
  subject { object.call(env) }

  let(:object)    { described_class.new(matcher, predicate) }
  let(:matcher)   { instance_double(Mutant::Matcher)        }
  let(:subject_a) { instance_double(Mutant::Subject)        }
  let(:subject_b) { instance_double(Mutant::Subject)        }
  let(:env)       { instance_double(Mutant::Env)            }
  let(:predicate) { ->(node) { node.eql?(subject_a) }       }

  before do
    expect(matcher).to receive(:call)
      .with(env)
      .and_return([subject_a, subject_b])
  end

  it 'returns subjects after filtering' do
    should eql([subject_a])
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mutant-0.8.16 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.15 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.14 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.13 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.12 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.11 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.10 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.9 spec/unit/mutant/matcher/filter_spec.rb
mutant-0.8.8 spec/unit/mutant/matcher/filter_spec.rb