Sha256: ce987df6ba1ad681231b755361f5e3dabb8f0f850e164953778a753029f1b9ad

Contents?: true

Size: 628 Bytes

Versions: 31

Compression:

Stored size: 628 Bytes

Contents

require_relative '../spec_helper'
require_lib 'reek/logging_error_handler'

RSpec.describe Reek::LoggingErrorHandler do
  describe '#handle' do
    let(:exception) { RuntimeError.new('some message') }
    let(:handler) { described_class.new }

    it "outputs the exception's message to stderr" do
      expect { handler.handle(exception) }.
        to output(/some message/).to_stderr
    end

    it 'indicates the exception has been appropriately handled' do
      result = false

      Reek::CLI::Silencer.silently do
        result = handler.handle(exception)
      end

      expect(result).to be_truthy
    end
  end
end

Version data entries

31 entries across 29 versions & 2 rubygems

Version Path
reek-4.8.2 spec/reek/logging_error_handler_spec.rb
reek-4.8.1 spec/reek/logging_error_handler_spec.rb
reek-4.8.0 spec/reek/logging_error_handler_spec.rb
reek-4.7.3 spec/reek/logging_error_handler_spec.rb
reek-4.7.2 spec/reek/logging_error_handler_spec.rb
reek-4.7.1 spec/reek/logging_error_handler_spec.rb
reek-4.7.0 spec/reek/logging_error_handler_spec.rb
reek-4.6.2 spec/reek/logging_error_handler_spec.rb
reek-4.6.1 spec/reek/logging_error_handler_spec.rb
reek-4.6.0 spec/reek/logging_error_handler_spec.rb
reek-4.5.6 spec/reek/logging_error_handler_spec.rb