@@ -12,7 +12,7 @@ describe Squib::Card do
|
||||
allow(Cairo::Context).to receive(:new).and_return(context)
|
||||
allow(Cairo::ImageSurface).to receive(:from_png).and_return(png)
|
||||
allow(Cairo::ImageSurface).to receive(:new).and_return(png)
|
||||
allow(RSVG::Handle).to receive(:new_from_file).and_return(svg)
|
||||
allow(RSVG::Handle).to receive(:new_from_data).and_return(svg)
|
||||
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_')
|
||||
@@ -58,8 +58,8 @@ describe Squib::Card do
|
||||
expect(context).to receive(:restore).once
|
||||
|
||||
card = Squib::Card.new(deck, 100, 150)
|
||||
# svg(file, id, x, y, width, height, alpha, blend, angle)
|
||||
card.svg('foo.png', 'id', 37, 38, :native, :native, 0.9, :none, 0.0, nil)
|
||||
# svg(file, data, id, x, y, width, height, alpha, blend, angle)
|
||||
card.svg(nil, '<svg></svg>', 'id', 37, 38, :native, :native, 0.9, :none, 0.0, nil)
|
||||
end
|
||||
|
||||
it 'sets blend when needed' do
|
||||
@@ -68,7 +68,7 @@ describe Squib::Card do
|
||||
expect(context).to receive(:operator=).with(:overlay).once
|
||||
|
||||
card = Squib::Card.new(deck, 100, 150)
|
||||
card.svg('foo.png', nil, 37, 38, :native, :native, 0.9, :overlay, 0.0, nil)
|
||||
card.svg(nil, '<svg></svg>', nil, 37, 38, :native, :native, 0.9, :overlay, 0.0, nil)
|
||||
end
|
||||
|
||||
it 'sets width & height when needed' do
|
||||
@@ -78,7 +78,7 @@ describe Squib::Card do
|
||||
expect(context).to receive(:scale).with(2.0, 3.0).once
|
||||
|
||||
card = Squib::Card.new(deck, 100, 150)
|
||||
card.svg('foo.png', nil, 37, 38, 200, 300, 0.9, :none, 0.0, nil)
|
||||
card.svg(nil, '<svg></svg>', nil, 37, 38, 200, 300, 0.9, :none, 0.0, nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user