Sha256: f28241407040a08661ce91407498cb5c987d37cab5ff972ebfcc2786a2650229

Contents?: true

Size: 1.14 KB

Versions: 24

Compression:

Stored size: 1.14 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Runner::Mutation, '#killer' do
  let(:object) { described_class.run(config, mutation) }

  let(:config) do
    double(
      'Config',
      fail_fast: fail_fast,
      reporter:  reporter,
      strategy:  strategy
    )
  end

  let(:reporter)  { double('Reporter')                          }
  let(:mutation)  { double('Mutation', class: Mutant::Mutation) }
  let(:strategy)  { double('Strategy')                          }
  let(:killer)    { double('Killer', success?: success)         }
  let(:fail_fast) { false                                       }
  let(:success)   { false                                       }

  subject { object.killer }

  before do
    reporter.stub(report: reporter)
    strategy.stub(kill: killer)
  end

  it 'should call configuration to identify strategy' do
    config.should_receive(:strategy).with(no_args).and_return(strategy)
    should be(killer)
  end

  it 'should run killer' do
    strategy.should_receive(:kill).with(mutation).and_return(killer)
    should be(killer)
  end

  it { should be(killer) }

  it_should_behave_like 'an idempotent method'
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mutant-0.5.12 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.11 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.10 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.9 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.8 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.7 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.6 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.5 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.4 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.3 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.2 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.1 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.5.0 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.6 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.5 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.4 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.3 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.2 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.1 spec/unit/mutant/runner/mutation/killer_spec.rb
mutant-0.3.0 spec/unit/mutant/runner/mutation/killer_spec.rb