Sha256: 6c81732a1f4284dbe7a421020cd432c21be05b77f9aa1620da0f16162f1a3c72

Contents?: true

Size: 767 Bytes

Versions: 13

Compression:

Stored size: 767 Bytes

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') }

  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(:fail?) { should be(true)  }
    it { should be_a(described_class) }
  end

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

    its(:fail?) { should be(false)   }
    it { should be_a(described_class) }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mutant-0.2.20 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.17 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.16 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.15 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.14 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.13 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.12 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.11 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.9 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.8 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.7 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.6 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb
mutant-0.2.5 spec/unit/mutant/killer/rspec/class_methods/new_spec.rb