Flip options for sprues (#251) (#277)

* Flipping works, now just need new argument

* Finishing up

* New test data
This commit is contained in:
Andy Meneely
2019-06-07 15:23:15 -04:00
committed by GitHub
parent a40c4d7dc4
commit cb66d7c31d
13 changed files with 62 additions and 15 deletions
+13
View File
@@ -0,0 +1,13 @@
sheet_width: 8.5in
sheet_height: 11in
card_width: 2.5in
card_height: 3.5in
cards:
- x: 0.5in
y: 1in
- x: 3.0in
y: 1in
flip_vertical: true
- x: 3.5in
y: 1in
flip_horizontal: true
+9
View File
@@ -144,6 +144,15 @@ describe Squib::Sprue do
)
end
it 'loads a template with flipped cards' do
tmpl = Squib::Sprue.load(sprue_file('card_flip.yml'), 100)
expect(tmpl.cards.length).to eq(3)
expect(tmpl.cards.map { |card| card['flip_vertical'] })
.to eq( [false, true, false] )
expect(tmpl.cards.map { |card| card['flip_horizontal'] })
.to eq( [false, false, true] )
end
it 'fails when sheet_width is not defined' do
expect do
Squib::Sprue.load(sprue_file('fail_no_sheet_width.yml'), 100)