spec/unit/berkshelf_spec.rb in berkshelf-3.0.0.beta7 vs spec/unit/berkshelf_spec.rb in berkshelf-3.0.0.beta8
- old
+ new
@@ -1,26 +1,23 @@
require 'spec_helper'
-describe Berkshelf do
- describe '::formatter' do
+module Berkshelf
+ describe '.formatter' do
context 'with default formatter' do
before { Berkshelf.instance_variable_set(:@formatter, nil) }
- it 'should be human readable' do
- expect(Berkshelf.formatter).to be_an_instance_of(Berkshelf::Formatters::HumanReadable)
+ 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
- include Berkshelf::Formatters::AbstractFormatter
- register_formatter :custom
- end
+ class CustomFormatter < BaseFormatter; end
before do
Berkshelf.set_format :custom
end
@@ -30,9 +27,9 @@
end
end
describe '::log' do
it 'returns Berkshelf::Logger' do
- expect(Berkshelf.log).to eq(Berkshelf::Logger)
+ expect(Berkshelf.log).to be_a(Berkshelf::Logger)
end
end
end