Sha256: d7e247700e4852163da461c1afffa124443f475a4f3f58ce01fc28aacfb62bfc

Contents?: true

Size: 780 Bytes

Versions: 24

Compression:

Stored size: 780 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:object)           { class_under_test.new(strategy, mutation) }
  let(:strategy)         { double('Strategy')                       }
  let(:mutation)         { double('Mutation', success?: kill_state) }
  let(:kill_state)       { double('Kill State')                     }

  before do
    kill_state.stub(freeze: kill_state, dup: kill_state)
  end

  let(:class_under_test) do
    Class.new(described_class) do
      def run
      end
    end
  end

  it_should_behave_like 'an idempotent method'

  it 'should use kill state to gather success' do
    mutation.should_receive(:success?).with(object).and_return(kill_state)
    should be(kill_state)
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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