Refactored spec with the splat operator
parent
f8ff4c8362
commit
aad7180c8b
|
|
@ -6,9 +6,7 @@ describe Squib::Deck, '#text' do
|
||||||
context 'fonts' do
|
context 'fonts' do
|
||||||
it "should use the default font when #text and #set_font don't specify" do
|
it "should use the default font when #text and #set_font don't specify" do
|
||||||
card = instance_double(Squib::Card)
|
card = instance_double(Squib::Card)
|
||||||
expect(card).to receive(:text).with('a', 'Arial 36',
|
expect(card).to receive(:text).with('a', 'Arial 36', *([anything] * 15)).once
|
||||||
anything, anything, anything,anything,anything,anything, anything, anything, anything,anything, anything, anything, anything, anything, anything
|
|
||||||
).once
|
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
@cards = [card]
|
@cards = [card]
|
||||||
text str: 'a'
|
text str: 'a'
|
||||||
|
|
@ -17,9 +15,7 @@ describe Squib::Deck, '#text' do
|
||||||
|
|
||||||
it "should use the #set_font when #text doesn't specify" do
|
it "should use the #set_font when #text doesn't specify" do
|
||||||
card = instance_double(Squib::Card)
|
card = instance_double(Squib::Card)
|
||||||
expect(card).to receive(:text).with('a', 'Times New Roman 16',
|
expect(card).to receive(:text).with('a', 'Times New Roman 16', *([anything] * 15)).once
|
||||||
anything, anything, anything, anything,anything,anything, anything, anything, anything,anything, anything, anything, anything, anything, anything
|
|
||||||
).once
|
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
@cards = [card]
|
@cards = [card]
|
||||||
set font: 'Times New Roman 16'
|
set font: 'Times New Roman 16'
|
||||||
|
|
@ -29,9 +25,7 @@ describe Squib::Deck, '#text' do
|
||||||
|
|
||||||
it 'should use the specified font no matter what' do
|
it 'should use the specified font no matter what' do
|
||||||
card = instance_double(Squib::Card)
|
card = instance_double(Squib::Card)
|
||||||
expect(card).to receive(:text).with('a', 'Arial 18',
|
expect(card).to receive(:text).with('a', 'Arial 18', *([anything] * 15)).once
|
||||||
anything, anything, anything, anything,anything,anything,anything, anything, anything,anything, anything, anything, anything, anything, anything
|
|
||||||
).once
|
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
@cards = [card]
|
@cards = [card]
|
||||||
set font: 'Times New Roman 16'
|
set font: 'Times New Roman 16'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue