Sha256: 52307448713e74877e805adb817c28e60a6807287aa73d2213b4e255217727a2

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

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

  subject { object.new(strategy, mutation) }

  let(:strategy)         { mock('Strategy', :spec_files => ['foo'], :error_stream => $stderr, :output_stream => $stdout) }
  let(:context)          { mock('Context')                                                                               }
  let(:mutation)         { mock('Mutation', :subject => mutation_subject)                                                }
  let(:mutation_subject) { mock('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

9 entries across 9 versions & 1 rubygems

Version Path
mutant-0.3.0.beta13 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta9 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta8 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta7 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta6 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.3.0.beta5 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb