Sha256: 8b11e8be568fe28b285c793ede2bd8b315da372f7f4090dc0a8a60fee2dcc1ff

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe Mutant::CLI, '.run' do
  subject { object.run(argv) }

  let(:object)     { described_class                               }
  let(:argv)       { mock('ARGV')                                  }
  let(:attributes) { mock('Options')                               }
  let(:runner)     { mock('Runner', :success? => success)          }
  let(:config)     { mock('Config')                                }
  let(:instance)   { mock(described_class.name, :config => config) }

  before do
    described_class.stub(:new => instance)
    Mutant::Runner::Config.stub(:run => runner)
  end

  context 'when runner is successful' do
    let(:success) { true }

    it { should be(0) }

    it 'should run with attributes' do
      Mutant::Runner::Config.should_receive(:run).with(config).and_return(runner)
      should be(0)
    end
  end

  context 'when runner fails' do
    let(:success) { false }

    it { should be(1) }

    it 'should run with attributes' do
      Mutant::Runner::Config.should_receive(:run).with(config).and_return(runner)
      should be(1)
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mutant-0.3.0.beta13 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta9 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta8 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta7 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta6 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta5 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta4 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta3 spec/unit/mutant/cli/class_methods/run_spec.rb
mutant-0.3.0.beta2 spec/unit/mutant/cli/class_methods/run_spec.rb