Sha256: e2c9b7a81faf49bf44ebde12e34ff36debbe77cb24219517638bf04267d830eb

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

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

  subject { object.new(strategy, mutation) }

  let(:strategy)         { double('Strategy', :spec_files => ['foo'], :error_stream => $stderr, :output_stream => $stdout) }
  let(:context)          { double('Context')                                                                               }
  let(:mutation)         { double('Mutation', :subject => mutation_subject)                                                }
  let(:mutation_subject) { double('Mutation Subject')                                                                      }

  let(:object)  { described_class }

  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 }

    its(:killed?) { should be(false) }

    it { should be_a(described_class) }
  end

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

    its(:killed?) { should be(true) }

    it { should be_a(described_class) }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta20 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta19 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta18 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta17 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta16 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta15 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta14 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb