Convert save_sheet and save_pdf to args classes

This commit is contained in:
Andy Meneely
2015-08-14 23:56:03 -04:00
parent bcc6d355d2
commit 3f2b057466
6 changed files with 156 additions and 73 deletions
+4 -2
View File
@@ -26,8 +26,9 @@ describe Squib::Deck, '#save_pdf' do
it 'make all the expected calls on a smoke test' do
num_cards = 9
deck = Squib::Deck.new(cards: 9, width: 825, height: 1125)
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir
expect(Squib.logger).to receive(:debug).at_least(:once)
expect(Squib.logger).to receive(:warn).exactly(:once) #warn about making the dir
expect(Dir).to receive(:mkdir) {} # don't actually make the dir
expect(cxt).to receive(:scale).with(0.24, 0.24)
expect_card_place(75, 75)
@@ -50,7 +51,8 @@ describe Squib::Deck, '#save_pdf' do
args = { range: 2..4, file: 'foo.pdf', dir: '_out', margin: 75, gap: 5, trim: 37 }
deck = Squib::Deck.new(cards: num_cards, width: 825, height: 1125)
expect(Squib.logger).to receive(:debug).at_least(:once)
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir
expect(Squib.logger).to receive(:warn).exactly(:once) #warn about making the dir
expect(Dir).to receive(:mkdir) {} # don't actually make the dir
expect(cxt).to receive(:scale).with(0.24, 0.24)
expect_card_place(75, 75)