Sha256: beb650f3357b0066011f8571e6accf540318c06da5a66328d257545d14da3d4f

Contents?: true

Size: 842 Bytes

Versions: 10

Compression:

Stored size: 842 Bytes

Contents

require 'spec_helper'

RSpec.describe Prawn::SVG::CSS::FontFamilyParser do
  describe "#parse" do
    it "correctly handles quotes and escaping" do
      tests = {
        "" => [],
        "font" => ["font"],
        "font name, other font" => ["font name", "other font"],
        "'font name', other font" => ["font name", "other font"],
        "'font, name', other font" => ["font, name", "other font"],
        '"font name", other font' => ["font name", "other font"],
        '"font, name", other font' => ["font, name", "other font"],
        'weird \\" name' => ['weird " name'],
        'weird\\, name' => ["weird, name"],
        ' stupid , spacing ' => ["stupid", "spacing"],
      }

      tests.each do |string, expected|
        expect(Prawn::SVG::CSS::FontFamilyParser.parse(string)).to eq expected
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
prawn-svg-0.34.2 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.34.1 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.34.0 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.33.0 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.32.0 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.31.0 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.30.0 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.29.1 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.29.0 spec/prawn/svg/css/font_family_parser_spec.rb
prawn-svg-0.28.0 spec/prawn/svg/css/font_family_parser_spec.rb