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:
Andy Meneely
2015-07-07 23:59:23 -04:00
parent 11f827cffa
commit e43f68d323
26 changed files with 441 additions and 456 deletions
-37
View File
@@ -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