Sha256: 2cbd92977836696ea8dc7e87aec95762f348c5f9473455b28d38516afe72e436

Contents?: true

Size: 488 Bytes

Versions: 9

Compression:

Stored size: 488 Bytes

Contents

require 'spec_helper'

describe Minimart::Error do
  describe '::handle_exception' do
    let(:ex) { StandardError.new('test error msg') }

    it 'should print the error' do
      begin; subject.handle_exception(ex); rescue SystemExit; end
      expect(Minimart::Configuration.output.io.string).to include 'test error msg'
    end

    it 'should exit with a failure status code' do
      expect {
        subject.handle_exception(ex)
      }.to raise_error SystemExit
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 spec/lib/minimart/error_spec.rb
minimart-1.2.4 spec/lib/minimart/error_spec.rb
minimart-1.2.3 spec/lib/minimart/error_spec.rb
minimart-1.2.0 spec/lib/minimart/error_spec.rb
minimart-1.1.6 spec/lib/minimart/error_spec.rb
minimart-1.1.3 spec/lib/minimart/error_spec.rb
minimart-1.0.2 spec/lib/minimart/error_spec.rb
minimart-1.0.1 spec/lib/minimart/error_spec.rb
minimart-0.0.1 spec/lib/minimart/error_spec.rb