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-6.0.3 spec/reek/logging_error_handler_spec.rb
reek-6.0.2 spec/reek/logging_error_handler_spec.rb
reek-6.0.1 spec/reek/logging_error_handler_spec.rb
reek-6.0.0 spec/reek/logging_error_handler_spec.rb
reek-5.6.0 spec/reek/logging_error_handler_spec.rb
reek-5.5.0 spec/reek/logging_error_handler_spec.rb
reek-5.4.1 spec/reek/logging_error_handler_spec.rb
reek-5.4.0 spec/reek/logging_error_handler_spec.rb
reek-5.3.2 spec/reek/logging_error_handler_spec.rb
reek-5.3.1 spec/reek/logging_error_handler_spec.rb
reek-5.3.0 spec/reek/logging_error_handler_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/logging_error_handler_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/logging_error_handler_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/logging_error_handler_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/logging_error_handler_spec.rb
reek-5.2.0 spec/reek/logging_error_handler_spec.rb
reek-5.1.0 spec/reek/logging_error_handler_spec.rb
reek-5.0.2 spec/reek/logging_error_handler_spec.rb
reek-5.0.1 spec/reek/logging_error_handler_spec.rb
reek-5.0.0 spec/reek/logging_error_handler_spec.rb