Warn on non-existing layout

Fix #99 and refactor args_loader a bit
This commit is contained in:
Andy Meneely
2015-07-26 21:50:43 -04:00
parent 003a26ae68
commit 54185fe9eb
2 changed files with 20 additions and 9 deletions
+11 -1
View File
@@ -79,6 +79,16 @@ describe Squib::Args::Box do
y: [0, 0], # Box default
)
end
it 'warns on non-existent layouts' do
args = { layout: :heal}
expect(Squib.logger).to receive(:warn).with('Layout "heal" does not exist in layout file - using default instead').at_least(:once)
box.load!(args, expand_by: 2, layout: layout)
expect(box).to have_attributes(
x: [0, 0], # Box default
y: [0, 0], # Box default
)
end
end
context 'unit conversion' do
@@ -114,4 +124,4 @@ describe Squib::Args::Box do
end
end
end