File: font_parser_test.rb

package info (click to toggle)
ruby-mojo-magick 0.6.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 376 kB
  • sloc: ruby: 755; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 645 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require_relative "test_helper"

IDENTIFY_FONT_RESPONSE = <<~EOFONT

  Font: Zapf-Dingbats
      family: Zapf Dingbats
      style: Normal
      stretch: Normal
      weight: 400
      glyphs: /System/Library/Fonts/ZapfDingbats.ttf

    Font: Zapfino
      family: Zapfino
      style: Italic
      stretch: Normal
      weight: 400
      glyphs: /Library/Fonts/Zapfino.ttf


EOFONT

class FontParserTest < Minitest::Test
  def test_parse_fonts
    parser = MojoMagick::Util::FontParser.new(IDENTIFY_FONT_RESPONSE)
    parsed_fonts = parser.parse
    assert_equal parsed_fonts.length, 2
    assert_equal parsed_fonts[1].style, "Italic"
  end
end