Sha256: 927007a1f985484ef32654757021195544fe944a0fba9b8462818748328ccc9f

Contents?: true

Size: 883 Bytes

Versions: 4

Compression:

Stored size: 883 Bytes

Contents

require 'spec_helper'

describe Phare::CLI do
  let(:cli) { described_class.new(env, argv) }
  let(:argv) { [] }
  let(:run!) { cli.run }

  describe :initialize do
    context 'with code check skipping' do
      let(:env) { { 'SKIP_CODE_CHECK' => '1' } }
      it { expect { run! }.to exit_with_code(0) }
    end

    context 'without code check skipping' do
      let(:env) { {} }

      context 'with suite errors' do
        before do
          expect(cli.suite).to receive(:run)
          expect(cli.suite).to receive(:status).and_return(1337)
        end

        it { expect { run! }.to exit_with_code(1) }
      end

      context 'without suite errors' do
        before do
          expect(cli.suite).to receive(:run)
          expect(cli.suite).to receive(:status).and_return(0)
        end

        it { expect { run! }.to exit_with_code(0) }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phare-0.5.2 spec/phare/cli_spec.rb
phare-0.5.1 spec/phare/cli_spec.rb
phare-0.5 spec/phare/cli_spec.rb
phare-0.4 spec/phare/cli_spec.rb