Use Layout from uh-layout as default

This commit is contained in:
Thibault Jouan
2015-04-10 17:37:19 +00:00
parent 616b14eae2
commit b9b2bff853
5 changed files with 35 additions and 17 deletions

View File

@@ -53,6 +53,24 @@ module Uh
end
end
describe '#layout' do
context 'when a layout class is set' do
let(:some_layout) { Class.new }
before { env.layout_class = some_layout }
it 'returns a new instance of this layout class' do
expect(env.layout).to be_an_instance_of some_layout
end
end
context 'when a layout class is not set' do
it 'returns an instance of the default layout' do
expect(env.layout).to be_an_instance_of ::Uh::Layout
end
end
end
describe '#logger' do
it 'returns a logger' do
expect(env.logger).to be_a Logger