Sha256: ce3718aa4eec58d98bf3c08683ebcf3783ed3ff4e2eb2a02f66bda9c94992cbf

Contents?: true

Size: 1.12 KB

Versions: 12

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe Mutant::Runner::Config, '#success?' do
  subject { object.success? }

  let(:object) { described_class.run(config) }

  let(:config) do
    mock(
      'Config',
      :reporter => reporter,
      :strategy => strategy,
      :subjects => subjects
    )
  end

  let(:reporter)  { mock('Reporter')                    }
  let(:strategy)  { mock('Strategy')                    }
  let(:subjects)  { [subject_a, subject_b]              }
  let(:subject_a) { mock('Subject A', :fails? => false) }
  let(:subject_b) { mock('Subject B', :fails? => false) }

  class DummySubjectRunner
    include Concord::Public.new(:config, :subject)

    def self.run(*args)
      new(*args)
    end

    def failed?
      @subject.fails?
    end
  end

  before do
    stub_const('Mutant::Runner::Subject', DummySubjectRunner)
    reporter.stub(:report => reporter)
    strategy.stub(:setup)
    strategy.stub(:teardown)
  end

  context 'without failed subjects' do
    it { should be(true) }
  end

  context 'with failing subjects' do
    before do
      subject_a.stub(:fails? => true)
    end

    it { should be(false) }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mutant-0.3.0.beta13 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta9 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta8 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta7 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta6 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta5 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta4 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta3 spec/unit/mutant/runner/config/success_predicate_spec.rb
mutant-0.3.0.beta2 spec/unit/mutant/runner/config/success_predicate_spec.rb