a19f3b1691
* I do not use 1.9.3 * Also keeping them in each file increases mental overhead (true it *can* be autoamted) * None of the files encodes NON ASCII chars. * I do not expect it makes any difference, since nobody programmatically will consume strings generated by mutant under the assumption they are UTF-8 encoded. * 1.9.3 Users have to deal with the encoding fuckup under ruby anyways.
46 lines
1.1 KiB
Ruby
46 lines
1.1 KiB
Ruby
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
|