feature: add use_layout method to load layouts at runtime

Closes #141
This commit is contained in:
Andy Meneely
2016-03-16 17:05:07 -04:00
parent b74fbf5787
commit 955d64a01f
5 changed files with 47 additions and 3 deletions
+13 -1
View File
@@ -186,4 +186,16 @@ describe Squib::LayoutParser do
})
end
end
it 'loads progressively on multiple calls' do
a = layout_file('multifile-a.yml')
b = layout_file('multifile-b.yml')
layout = Squib::LayoutParser.load_layout(a)
layout = Squib::LayoutParser.load_layout(b, layout)
expect(layout).to eq({
'title' => { 'x' => 300 },
'subtitle' => { 'x' => 200 },
'desc' => { 'x' => 400 }
})
end
end