Sha256: bb11a58150dab1699c504c9eed791676039389efdaea223a754427c06b2552b2

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'
require 'omnitest/cli'

module Omnitest
  module CLI
    describe OmnitestCLI do
      let(:kernel) { double(:kernel) }
      subject { ThorSpy.on(described_class, kernel) }
      describe 'bootstrap' do
        context 'with no args' do
          xit 'calls bootstrap on each project' do
            expect(kernel).to receive(:exit).with(0)
            # TODO: Any way to test each project is called? We can't use
            # `Omnitest.projects` because it will be reloaded.
            subject.bootstrap
          end
        end

        context 'with an existing project' do
          xit 'calls bootstrap on the project' do
            # expect(@project).to receive(:bootstrap)
            expect(kernel).to receive(:exit).with(0)
            subject.bootstrap('test')
            expect(subject.stderr.string).to eq('')
          end
        end

        context 'with an non-existant project' do
          it 'fails' do
            expect(kernel).to receive(:exit).with(1)
            subject.bootstrap('missing')
            expect(subject.stderr.string).to include('No projects matching regex `missing\'')
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omnitest-0.2.2 spec/omnitest/cli_spec.rb
omnitest-0.2.1 spec/omnitest/cli_spec.rb