change x= to *=, add unit tests and improve existing tests
This commit is contained in:
committed by
Andy Meneely
parent
b3bd8f03d8
commit
8509ab5728
@@ -1,8 +1,12 @@
|
||||
parent:
|
||||
x: 0.5in
|
||||
x: 100
|
||||
y: 1in
|
||||
width: 200
|
||||
height: 1cm
|
||||
|
||||
child:
|
||||
extends: parent
|
||||
x: += 1in
|
||||
y: -= 0.5in
|
||||
y: -= 1cm
|
||||
width: "*= 1.5"
|
||||
height: /= 4
|
||||
|
||||
@@ -206,8 +206,13 @@ describe Squib::LayoutParser do
|
||||
it 'does mixed unit conversion when extending' do
|
||||
layout = subject.load_layout(layout_file('extends-units-mixed.yml'))
|
||||
expect(layout).to eq({
|
||||
'parent' => { 'x' => '0.5in', 'y' => '1in'},
|
||||
'child' => { 'x' => 450.0, 'y' => 150.0, 'extends' => 'parent' },
|
||||
'parent' => {
|
||||
'x' => 100, 'y' => '1in',
|
||||
'width' => 200, 'height' => '1cm' },
|
||||
'child' => {
|
||||
'x' => 400.0, 'y' => 181.8897639,
|
||||
'width' => 300.0, 'height' => 29.527559025,
|
||||
'extends' => 'parent' },
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user