Sha256: 94f46f60ca72fa8c8a0f56f69b5f6a95612b363c0812b83c49d2aa17abe21995

Contents?: true

Size: 802 Bytes

Versions: 30

Compression:

Stored size: 802 Bytes

Contents

require 'spec_helper'

module Berkshelf
  describe '.formatter' do
    context 'with default formatter' do
      before { Berkshelf.instance_variable_set(:@formatter, nil) }

      it 'is human readable' do
        expect(Berkshelf.formatter).to be_an_instance_of(HumanFormatter)
      end
    end

    context 'with a custom formatter' do
      before(:all) do
        Berkshelf.instance_eval { @formatter = nil }
      end

      class CustomFormatter < BaseFormatter; end

      before do
        Berkshelf.set_format :custom
      end

      it 'is custom class' do
        expect(Berkshelf.formatter).to be_an_instance_of(CustomFormatter)
      end
    end
  end

  describe '::log' do
    it 'returns Berkshelf::Logger' do
      expect(Berkshelf.log).to be_a(Berkshelf::Logger)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
berkshelf-4.3.5 spec/unit/berkshelf_spec.rb
berkshelf-4.3.3 spec/unit/berkshelf_spec.rb
berkshelf-4.3.2 spec/unit/berkshelf_spec.rb
berkshelf-4.3.1 spec/unit/berkshelf_spec.rb
berkshelf-4.3.0 spec/unit/berkshelf_spec.rb
berkshelf-4.2.3 spec/unit/berkshelf_spec.rb
berkshelf-4.2.2 spec/unit/berkshelf_spec.rb
berkshelf-4.2.1 spec/unit/berkshelf_spec.rb
berkshelf-4.2.0 spec/unit/berkshelf_spec.rb
berkshelf-4.1.1 spec/unit/berkshelf_spec.rb
berkshelf-4.1.0 spec/unit/berkshelf_spec.rb
berkshelf-4.0.1 spec/unit/berkshelf_spec.rb
berkshelf-4.0.0 spec/unit/berkshelf_spec.rb
berkshelf-3.3.0 spec/unit/berkshelf_spec.rb
berkshelf-3.2.4 spec/unit/berkshelf_spec.rb
berkshelf-3.2.3 spec/unit/berkshelf_spec.rb
berkshelf-3.2.2 spec/unit/berkshelf_spec.rb
berkshelf-3.2.1 spec/unit/berkshelf_spec.rb
berkshelf-3.2.0 spec/unit/berkshelf_spec.rb
berkshelf-3.1.5 spec/unit/berkshelf_spec.rb