Sha256: 892288f113aeb1e0ab7615898d850411959fb0a11eb425109ece931cd77327af

Contents?: true

Size: 1.14 KB

Versions: 31

Compression:

Stored size: 1.14 KB

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:object)     { described_class                              }
  let(:argv)       { double('ARGV')                               }
  let(:attributes) { double('Options')                            }
  let(:runner)     { double('Runner', success?: success)          }
  let(:config)     { double('Config')                             }
  let(:instance)   { double(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

31 entries across 31 versions & 1 rubygems

Version Path
mutant-0.5.19 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.18 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.17 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.16 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.15 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.14 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.13 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.12 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.11 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.10 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.9 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.8 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.7 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.6 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.5 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.4 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.3 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.2 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.1 spec/unit/mutant/cli_run_spec.rb
mutant-0.5.0 spec/unit/mutant/cli_run_spec.rb