Sha256: 1d4a1a3fa4dd0a8348bfad74b5912dab43746b04a13d347b5d756d7cf6070e77

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'
require 'polytrix/cli'

module Polytrix
  module CLI
    describe Main do
      let(:kernel) { double(:kernel) }
      subject { ThorSpy.on(described_class, kernel) }
      describe 'bootstrap' do
        context 'with no args' do
          it 'calls Polytrix.bootstrap' do
            expect(kernel).to receive(:exit).with(0)
            expect(Polytrix).to receive(:bootstrap)
            subject.bootstrap
          end
        end

        context 'with an existing SDK' do
          before do
            @implementor = Polytrix.configuration.implementor name: 'test', basedir: '.'
          end

          it 'calls bootstrap on the SDK' do
            expect(@implementor).to receive(:bootstrap)
            expect(kernel).to receive(:exit).with(0)
            expect(subject.stderr.string).to eq('')
            subject.bootstrap('test')
          end
        end

        context 'with an non-existant SDK' do
          it 'fails' do
            expect { subject.bootstrap('missing') }.to raise_error(SystemExit, 'SDK missing not found')
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polytrix-0.1.0.pre spec/polytrix/cli_spec.rb