Ported text command over to the new args classes
* Involved a big rewrite of arg_loader to accomodate nil and false better. Sadly this meant dumping ||= for if-statements. Blech, but works. * Updates to regression tests are pretty trivial. * Removed graphics_text_spec because, even though it looks useful, with rake sanity it really isn't. * Exposed font on deck as well Cleaned up graphics/text.rb too!
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
require 'spec_helper'
|
||||
require 'squib'
|
||||
|
||||
describe Squib::Deck, '#text' do
|
||||
|
||||
context 'fonts' do
|
||||
it "should use the default font when #text and #set_font don't specify" do
|
||||
card = instance_double(Squib::Card)
|
||||
expect(card).to receive(:text).with(anything, 'a', 'Arial 36', *([anything] * 17)).once
|
||||
Squib::Deck.new do
|
||||
@cards = [card]
|
||||
text str: 'a'
|
||||
end
|
||||
end
|
||||
|
||||
it "should use the #set_font when #text doesn't specify" do
|
||||
card = instance_double(Squib::Card)
|
||||
expect(card).to receive(:text).with(anything, 'a', 'Times New Roman 16', *([anything] * 17)).once
|
||||
Squib::Deck.new do
|
||||
@cards = [card]
|
||||
set font: 'Times New Roman 16'
|
||||
text str: 'a'
|
||||
end
|
||||
end
|
||||
|
||||
it 'should use the specified font no matter what' do
|
||||
card = instance_double(Squib::Card)
|
||||
expect(card).to receive(:text).with(anything, 'a', 'Arial 18', *([anything] * 17)).once
|
||||
Squib::Deck.new do
|
||||
@cards = [card]
|
||||
set font: 'Times New Roman 16'
|
||||
text str: 'a', font: 'Arial 18'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user