Skip to content

Commit

Permalink
Merge pull request dtao#68 from sanemat/feature/spec-bundle-parallel-…
Browse files Browse the repository at this point in the history
…option

Add spec bundle parallel option
  • Loading branch information
sanemat committed Dec 23, 2013
2 parents 3fb84eb + 5509d8f commit ae952c4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions spec/tachikoma/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,35 @@
Tachikoma::Application.run 'carton'
end
end

describe '#bundler_parallel_option' do
subject { described_class.new }

context 'bundler does not support parallel' do
let(:bundler_version) { '1.3.5' }
let(:parallel_number) { 3 }
it 'returns nil' do
expect(subject.bundler_parallel_option(bundler_version, parallel_number)).to be_nil
end
end

context 'bundler supports parallel' do
let(:bundler_version) { '1.5.0' }

context 'parallel less than 1' do
let(:parallel_number) { 1 }
it 'returns nil' do
expect(subject.bundler_parallel_option(bundler_version, parallel_number)).to be_nil
end
end

context 'parallel above 1' do
let(:parallel_number) { 3 }
let(:parallel_option) { "--jobs=#{parallel_number}" }
it 'returns parallel option' do
expect(subject.bundler_parallel_option(bundler_version, parallel_number)).to eq parallel_option
end
end
end
end
end

0 comments on commit ae952c4

Please sign in to comment.