Sha256: 56022f1605e0c145a78d40ac3964711e30e59eb79751147b1c796757ec7d982d

Contents?: true

Size: 545 Bytes

Versions: 26

Compression:

Stored size: 545 Bytes

Contents

require 'spec_helper'

describe Berkshelf::Mixin::Logging do
  subject do
    Class.new { include Berkshelf::Mixin::Logging }.new
  end

  describe '#log' do
    it 'returns the Berkshelf::Logger' do
      expect(subject.log).to eq(Berkshelf::Logger)
    end
  end

  describe '#log_exception' do
    it 'logs the exception and backtrace as fatal' do
      ex = Exception.new('msg')
      ex.stub(:backtrace).and_return(['one', 'two'])
      subject.log.should_receive(:fatal).exactly(2).times

      subject.log_exception(ex)
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
berkshelf-2.0.18 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.17 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.16 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.15 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta7 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta6 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.14 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta5 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.13 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.12 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.11 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta4 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta3 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.10 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.9 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.8 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta2 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-3.0.0.beta1 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.7 spec/unit/berkshelf/mixin/logging_spec.rb
berkshelf-2.0.6 spec/unit/berkshelf/mixin/logging_spec.rb