Sha256: e7f05f6e565e93cb10ef22ad204c5a67c700c45262d7e8efac356db867fa69ae

Contents?: true

Size: 1022 Bytes

Versions: 17

Compression:

Stored size: 1022 Bytes

Contents

# frozen_string_literal: true

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

17 entries across 17 versions & 1 rubygems

Version Path
mutant-0.9.8 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.7 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.6 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.5 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.4 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.3 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.2 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.1 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.9.0 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.24 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.23 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.22 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.21 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.20 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.19 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.18 spec/unit/mutant/matcher/scope_spec.rb
mutant-0.8.17 spec/unit/mutant/matcher/scope_spec.rb