@@ -1,3 +1,6 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color(["#ccc"])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: rounded_rectangle([300, 300, 400, 400, 0, 0])
|
||||
cairo: set_source_color([:red])
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source([LinearPattern])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:black])
|
||||
cairo: translate([0, 0])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color(["#0b7c8e"])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color(["#aaa"])
|
||||
cairo: paint([])
|
||||
@@ -20,6 +21,7 @@ cairo: update_pango_layout([MockDouble])
|
||||
cairo: show_pango_layout([MockDouble])
|
||||
cairo: restore([])
|
||||
surface: write_to_png(["_output/portrait_00.png"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color(["#aaa"])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:gray])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color(["#CE534D"])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color([:white])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
cairo: antialias=(["best"])
|
||||
cairo: save([])
|
||||
cairo: set_source_color(["#ddd"])
|
||||
cairo: paint([])
|
||||
|
||||
@@ -15,10 +15,13 @@ describe Squib::Card do
|
||||
allow(@deck).to receive(:dir).and_return('_output')
|
||||
allow(@deck).to receive(:count_format).and_return('%02d')
|
||||
allow(@deck).to receive(:prefix).and_return('card_')
|
||||
allow(@deck).to receive(:antialias).and_return('best')
|
||||
|
||||
end
|
||||
|
||||
context '#png' do
|
||||
it 'makes all the expected calls on a smoke test' do
|
||||
expect(@context).to receive(:antialias=).with('best')
|
||||
expect(@context).to receive(:save).once
|
||||
expect(@context).to receive(:translate).with(-37, -38).once
|
||||
expect(@context).to receive(:rotate).with(0.0).once
|
||||
@@ -45,6 +48,7 @@ describe Squib::Card do
|
||||
it 'makes all the expected calls on a smoke test' do
|
||||
expect(@svg).to receive(:width).and_return(100).twice
|
||||
expect(@svg).to receive(:height).and_return(100).twice
|
||||
expect(@context).to receive(:antialias=).with('best').once
|
||||
expect(@context).to receive(:save).once
|
||||
expect(@context).to receive(:rotate).with(0.0).once
|
||||
expect(@context).to receive(:translate).with(37, 38).once
|
||||
|
||||
@@ -20,13 +20,14 @@ describe Squib::Deck, '#save_pdf' do
|
||||
before(:each) do
|
||||
allow(Cairo::PDFSurface).to receive(:new).and_return(nil) #don't create the file
|
||||
allow(Cairo::Context).to receive(:new).and_return(cxt)
|
||||
allow(cxt).to receive(:antialias=)
|
||||
end
|
||||
|
||||
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(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(:debug).at_least(:once)
|
||||
|
||||
expect_card_place(75, 75)
|
||||
expect_card_place(831, 75)
|
||||
|
||||
@@ -18,10 +18,12 @@ describe Squib::Card do
|
||||
allow(@deck).to receive(:dir).and_return('_output')
|
||||
allow(@deck).to receive(:count_format).and_return('%02d')
|
||||
allow(@deck).to receive(:prefix).and_return('card_')
|
||||
allow(@deck).to receive(:antialias).and_return('best')
|
||||
end
|
||||
|
||||
context 'rect' do
|
||||
it 'make all the expected calls on a smoke test' do
|
||||
expect(@context).to receive(:antialias=).with('best')
|
||||
expect(@context).to receive(:save).once
|
||||
expect(@context).to receive(:rounded_rectangle).with(37, 38, 50, 100, 10, 15).twice
|
||||
expect_stroke('#fff', '#f00', 2.0)
|
||||
@@ -36,6 +38,7 @@ describe Squib::Card do
|
||||
|
||||
context 'circle' do
|
||||
it 'make all the expected calls on a smoke test' do
|
||||
expect(@context).to receive(:antialias=).with('best')
|
||||
expect(@context).to receive(:save).once
|
||||
expect(@context).to receive(:move_to).with(137, 38)
|
||||
expect(@context).to receive(:circle).with(37, 38, 100).twice
|
||||
@@ -51,6 +54,7 @@ describe Squib::Card do
|
||||
|
||||
context 'triangle' do
|
||||
it 'make all the expected calls on a smoke test' do
|
||||
expect(@context).to receive(:antialias=).with('best')
|
||||
expect(@context).to receive(:save).once
|
||||
expect(@context).to receive(:triangle).with(1, 2, 3, 4, 5, 6).twice
|
||||
expect_stroke('#fff', '#f00', 2.0)
|
||||
@@ -63,6 +67,7 @@ describe Squib::Card do
|
||||
|
||||
context 'line' do
|
||||
it 'make all the expected calls on a smoke test' do
|
||||
expect(@context).to receive(:antialias=).with('best')
|
||||
expect(@context).to receive(:save).once
|
||||
expect(@context).to receive(:move_to).with(1, 2).once
|
||||
expect(@context).to receive(:line_to).with(3, 4).once
|
||||
|
||||
@@ -14,11 +14,13 @@ describe Squib::Card, '#text' do
|
||||
allow(deck).to receive(:dir).and_return('_output')
|
||||
allow(deck).to receive(:count_format).and_return('%02d')
|
||||
allow(deck).to receive(:prefix).and_return('card_')
|
||||
allow(deck).to receive(:antialias).and_return('best')
|
||||
end
|
||||
|
||||
it 'make all the expected calls on a smoke test' do
|
||||
extent = Pango::Rectangle.new(50,60,100,200)
|
||||
expect(Squib.logger).to receive(:debug).once
|
||||
expect(context).to receive(:antialias=).with('best').once
|
||||
expect(context).to receive(:save).once
|
||||
expect(context).to receive(:set_source_color).once
|
||||
expect(context).to receive(:move_to).with(10, 15).once
|
||||
@@ -67,6 +69,7 @@ describe Squib::Card, '#text' do
|
||||
allow(deck).to receive(:dir).and_return('_output')
|
||||
allow(deck).to receive(:count_format).and_return('%02d')
|
||||
allow(deck).to receive(:prefix).and_return('card_')
|
||||
allow(deck).to receive(:antialias).and_return('best')
|
||||
end
|
||||
|
||||
it 'aligns right with strings' do
|
||||
|
||||
+2
-1
@@ -76,7 +76,8 @@ def mock_cairo(strio)
|
||||
%w(save set_source_color paint restore translate rotate move_to
|
||||
update_pango_layout width height show_pango_layout rounded_rectangle
|
||||
set_line_width stroke fill set_source scale render_rsvg_handle circle
|
||||
triangle line_to operator= show_page clip transform mask rectangle reset_clip).each do |m|
|
||||
triangle line_to operator= show_page clip transform mask rectangle
|
||||
reset_clip antialias=).each do |m|
|
||||
allow(cxt).to receive(m) { |*args| strio << scrub_hex("cairo: #{m}(#{args})\n") }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user