Sha256: 7d6126f53bc405a8d6b645086460cbbbce60831dfcfc2f13b2c45b08d431bf1e

Contents?: true

Size: 1.22 KB

Versions: 16

Compression:

Stored size: 1.22 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe Prawn::Svg::Font do
  describe :load do
    it "matches a built in font" do
      Prawn::Svg::Font.load("blah, 'courier', nothing").name.should == 'Courier'
    end

    it "matches a default font" do
      Prawn::Svg::Font.load("serif").name.should == 'Times-Roman'
      Prawn::Svg::Font.load("blah, serif").name.should == 'Times-Roman'
      Prawn::Svg::Font.load("blah, serif , test").name.should == 'Times-Roman'
    end

    if Prawn::Svg::Font.installed_fonts["Verdana"]
      it "matches a font installed on the system" do
        Prawn::Svg::Font.load("verdana, sans-serif").name.should == 'Verdana'
        Prawn::Svg::Font.load("VERDANA, sans-serif").name.should == 'Verdana'
        Prawn::Svg::Font.load("something, \"Times New Roman\", serif").name.should == "Times New Roman"
        Prawn::Svg::Font.load("something, Times New Roman, serif").name.should == "Times New Roman"
      end
    else
      it "not running font test because we couldn't find Verdana installed on the system"
    end

    it "returns nil if it can't find any such font" do
      Prawn::Svg::Font.load("blah, thing").should be_nil
      Prawn::Svg::Font.load("").should be_nil
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
prawn-svg-0.21.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.20.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.19.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.18.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.17.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.16.2 spec/prawn/svg/font_spec.rb
prawn-svg-0.16.1 spec/prawn/svg/font_spec.rb
prawn-svg-0.16.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.15.0.0 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.12 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.11 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.10 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.9 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.8 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.7 spec/prawn/svg/font_spec.rb
prawn-svg-0.12.0.6 spec/prawn/svg/font_spec.rb