Sha256: d94fbb832d43bbe1f836a153a3a2ba760acf0129a4cf9cdb5f0cedaa54e406bb

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe GithubCLI, 'dsl' do
  let(:object)    { described_class }
  let(:error_cli) { GithubCLI::GitHubError }

  before {
    GithubCLI.ui.stub(:error)
    GithubCLI.ui.stub(:debug)
  }

  after {
    GithubCLI.ui.unstub(:error)
    GithubCLI.ui.unstub(:debug)
  }

  context 'on_error' do
    it "handles internal cli errors" do
      expect { object.on_error { raise error_cli } }.to exit_with_code(11)
    end

    it "handles interrupts" do
      expect { object.on_error { raise Interrupt } }.to exit_with_code(1)
    end

    it "handles fatal exceptions" do
      expect { object.on_error { raise Exception } }.to exit_with_code(1)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github_cli-0.6.2 spec/github_cli/dsl_spec.rb