Sha256: 8415b53817510e23bbad2d4ef47291df983d50f2604fe7ac0cafa0baf27a8942

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'
require 'polytrix/cli'

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

      context 'with an existing SDK' do
        xit '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(kernel).to receive(:exit).with(1)
          subject.bootstrap('missing')
          expect(subject.stdout.string).to include('No scenarios for regex')
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polytrix-0.1.4 spec/polytrix/cli_spec.rb
polytrix-0.1.3 spec/polytrix/cli_spec.rb
polytrix-0.1.2 spec/polytrix/cli_spec.rb
polytrix-0.1.1 spec/polytrix/cli_spec.rb
polytrix-0.1.0 spec/polytrix/cli_spec.rb