Accept -l LAYOUT CLI option to set the layout

This commit is contained in:
Thibault Jouan
2015-04-10 06:11:33 +00:00
parent 0ce73c2e2f
commit b65e989c38
5 changed files with 19 additions and 1 deletions

View File

@@ -130,6 +130,15 @@ module Uh
end
end
context 'with layout option' do
let(:arguments) { %w[-l Object] }
it 'assigns the layout class in the env' do
cli.parse_arguments!
expect(cli.env.layout_class).to eq Object
end
end
context 'with invalid option' do
let(:arguments) { %w[--unknown-option] }

View File

@@ -13,6 +13,10 @@ module Uh
expect(env).not_to be_debug
end
it 'has no layout_class set' do
expect(env.layout_class).not_to be
end
describe '#verbose?' do
context 'when verbose mode is disabled' do
before { env.verbose = false }