Sha256: fb46684380c1793deb46ea371647f3f70eb49ba08da5fc904ed1822039249218

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8

require 'spec_helper'
require 'mutant-rspec'

describe Mutant::Rspec::Killer, '.new' do

  before do
    pending 'dactivated'
  end

  subject { object.new(strategy, mutation) }

  let(:context)          { double('Context')          }
  let(:mutation_subject) { double('Mutation Subject') }

  let(:object)  { described_class }

  let(:mutation) do
    double(
      'Mutation',
      subject: mutation_subject,
      should_survive?: false
    )
  end

  let(:strategy) do
    double(
      'Strategy',
      spec_files: ['foo'],
      error_stream: $stderr,
      output_stream: $stdout
    )
  end

  before do
    mutation.stub(:insert)
    mutation.stub(:reset)
    RSpec::Core::Runner.stub(run: exit_status)
  end

  context 'when run exits zero' do
    let(:exit_status) { 0 }

    it { expect(subject.killed?).to be(false) }

    it { should be_a(described_class) }
  end

  context 'when run exits nonzero' do
    let(:exit_status) { 1 }

    it { expect(subject.killed?).to be(true) }

    it { should be_a(described_class) }
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
mutant-0.5.12 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.11 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.10 spec/unit/mutant/rspec/killer_spec.rb
mutant-rspec-0.5.10 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.9 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.8 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.7 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.6 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.5 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.4 spec/unit/mutant/rspec/killer_spec.rb
mutant-rspec-0.5.3 spec/unit/mutant/rspec/killer_spec.rb
mutant-0.5.3 spec/unit/mutant/rspec/killer_spec.rb