Sha256: 448a28bd9c2a9db8b50e288dc2a5601d71f4d1d477e980d0ac48df78b7fc7878

Contents?: true

Size: 999 Bytes

Versions: 9

Compression:

Stored size: 999 Bytes

Contents

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

  let(:scope)     { TestApp }
  let(:object)    { described_class.new(scope)       }
  let(:env)       { instance_double(Mutest::Env)     }
  let(:matcher_a) { instance_double(Mutest::Matcher) }
  let(:matcher_b) { instance_double(Mutest::Matcher) }
  let(:subject_a) { instance_double(Mutest::Subject) }
  let(:subject_b) { instance_double(Mutest::Subject) }

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

    expect(Mutest::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
    is_expected.to eql([subject_a, subject_b])
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mutest-0.0.10 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.9 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.8 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.7 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.6 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.5 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.4 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.3 spec/unit/mutest/matcher/scope_spec.rb
mutest-0.0.2 spec/unit/mutest/matcher/scope_spec.rb