Sha256: 5e6ded358eba85d5555d4462a2d06cbd5f455a4edb1a65e66cdcb3e8eb48f215

Contents?: true

Size: 860 Bytes

Versions: 18

Compression:

Stored size: 860 Bytes

Contents

require 'spec_helper'

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

  let(:object)           { class_under_test.new(strategy, mutation) }
  let(:strategy)         { mock('Strategy')                         }
  let(:mutation)         { mock('Mutation')                         }

  before do
    mutation.stub(:insert)
    mutation.stub(:reset)
  end

  let(:class_under_test) do
    kill_state = self.kill_state
    Class.new(described_class) do
      define_method :run do
        kill_state
      end
    end
  end

  context 'when mutant was killed' do
    let(:kill_state) { true }
    
    it_should_behave_like 'an idempotent method'

    it { should be(false) }
  end

  context 'when mutant was NOT killed' do
    let(:kill_state) { false }
    
    it_should_behave_like 'an idempotent method'

    it { should be(true) }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mutant-0.2.20 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.17 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.16 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.15 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.14 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.13 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.12 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.11 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.9 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.8 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.7 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.6 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.5 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.4 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.3 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.2 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.1 spec/unit/mutant/killer/fail_ques_spec.rb
mutant-0.2.0 spec/unit/mutant/killer/fail_ques_spec.rb