refactoring to get middle/center, possibly more

This commit is contained in:
Andy Meneely
2020-10-05 11:27:49 -04:00
parent 0de6b31ad7
commit 4003e00e2a
14 changed files with 175 additions and 8 deletions
+13
View File
@@ -122,6 +122,19 @@ describe Squib::Args::Box do
expect(box).to have_attributes(x_radius: [3], y_radius: [3])
end
it 'listens to middle' do
args = { width: :middle, height: 'middle' }
box = Squib::Args::Box.new
box.extract! args, deck
expect(box).to have_attributes(width: [61.5], height: [228.0])
end
it 'listens to center' do
args = { width: 'center', height: :center }
box = Squib::Args::Box.new
box.extract! args, deck
expect(box).to have_attributes(width: [61.5], height: [228.0])
end
end
+4
View File
@@ -30,5 +30,9 @@ describe Squib::Args::UnitConversion do
expect(subject.parse('1mm ')).to eq(11.81102361)
end
it 'does deg' do
expect(subject.parse('30deg')).to be_within(0.0001).of(0.523599)
end
end