Sha256: 16e9e2079558e38e5fff6fb223b95d5c7a6edf2d05bdc778ab17f6dec3c3869d

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

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('a', 'Arial 36', *([anything] * 15)).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('a', 'Times New Roman 16', *([anything] * 15)).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('a', 'Arial 18', *([anything] * 15)).once
      Squib::Deck.new do
        @cards = [card]
        set font: 'Times New Roman 16'
        text str: 'a', font: 'Arial 18'
      end
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
squib-0.4.0 spec/api/api_text_spec.rb
squib-0.3.0 spec/api/api_text_spec.rb
squib-0.2.0 spec/api/api_text_spec.rb
squib-0.1.0 spec/api/api_text_spec.rb
squib-0.0.6 spec/api/api_text_spec.rb
squib-0.0.5 spec/api/api_text_spec.rb