Sha256: 65f4120a99af8c09b4a550fad672a617b74bb31b02973de312cb5058994106cd

Contents?: true

Size: 991 Bytes

Versions: 9

Compression:

Stored size: 991 Bytes

Contents

RSpec.describe Mutant::Matcher::Scope, '#call' do
  let(:scope)     { TestApp }
  let(:object)    { described_class.new(scope)       }
  let(:env)       { instance_double(Mutant::Env)     }
  let(:matcher_a) { instance_double(Mutant::Matcher) }
  let(:matcher_b) { instance_double(Mutant::Matcher) }
  let(:subject_a) { instance_double(Mutant::Subject) }
  let(:subject_b) { instance_double(Mutant::Subject) }

  subject { object.call(env) }

  before do
    expect(Mutant::Matcher::Methods::Singleton).to receive(:new)
      .with(scope)
      .and_return(matcher_a)

    expect(Mutant::Matcher::Methods::Instance).to receive(:new)
      .with(scope)
      .and_return(matcher_b)

    expect(matcher_a).to receive(:call)
      .with(env)
      .and_return([subject_a])

    expect(matcher_b).to receive(:call)
      .with(env)
      .and_return([subject_b])
  end

  it 'concatenates subjects from matched singleton and instance methods' do
    should eql([subject_a, subject_b])
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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