|
|
|
@ -24,7 +24,6 @@ describe Squib::Deck, '#save_pdf' do |
|
|
|
num_cards = 9 |
|
|
|
num_cards = 9 |
|
|
|
args = { file: 'foo.pdf', dir: '_out', margin: 75, gap: 5, trim: 37 } |
|
|
|
args = { file: 'foo.pdf', dir: '_out', margin: 75, gap: 5, trim: 37 } |
|
|
|
deck = Squib::Deck.new(cards: num_cards, width: 825, height: 1125) |
|
|
|
deck = Squib::Deck.new(cards: num_cards, width: 825, height: 1125) |
|
|
|
mock_squib_logger(@old_logger) do |
|
|
|
|
|
|
|
expect(Squib.logger).to receive(:debug).at_least(:once) |
|
|
|
expect(Squib.logger).to receive(:debug).at_least(:once) |
|
|
|
expect(Cairo::Context).to receive(:new).and_return(@context).exactly(num_cards + 1).times |
|
|
|
expect(Cairo::Context).to receive(:new).and_return(@context).exactly(num_cards + 1).times |
|
|
|
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir |
|
|
|
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir |
|
|
|
@ -42,13 +41,11 @@ describe Squib::Deck, '#save_pdf' do |
|
|
|
|
|
|
|
|
|
|
|
deck.save_pdf(args) |
|
|
|
deck.save_pdf(args) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it 'only does the three cards on a limited range' do |
|
|
|
it 'only does the three cards on a limited range' do |
|
|
|
num_cards = 9 |
|
|
|
num_cards = 9 |
|
|
|
args = { range: 2..4, file: 'foo.pdf', dir: '_out', margin: 75, gap: 5, trim: 37 } |
|
|
|
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) |
|
|
|
deck = Squib::Deck.new(cards: num_cards, width: 825, height: 1125) |
|
|
|
mock_squib_logger(@old_logger) do |
|
|
|
|
|
|
|
expect(Squib.logger).to receive(:debug).at_least(:once) |
|
|
|
expect(Squib.logger).to receive(:debug).at_least(:once) |
|
|
|
expect(Cairo::Context).to receive(:new).and_return(@context).exactly(4).times |
|
|
|
expect(Cairo::Context).to receive(:new).and_return(@context).exactly(4).times |
|
|
|
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir |
|
|
|
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir |
|
|
|
@ -59,7 +56,6 @@ describe Squib::Deck, '#save_pdf' do |
|
|
|
|
|
|
|
|
|
|
|
deck.save_pdf(args) |
|
|
|
deck.save_pdf(args) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|