File: rbpdf_font_style_test.rb

package info (click to toggle)
ruby-rbpdf 1.21.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,488 kB
  • sloc: ruby: 138,259; makefile: 12
file content (37 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (4)
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
30
31
32
33
34
35
36
37
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT

require 'test_helper'

class RbpdfFontStyleTest < Test::Unit::TestCase
  class MYPDF < RBPDF
    def dounderline(x, y, txt)
      super
    end
    def dolinethrough(x, y, txt)
      super
    end
    def dooverline(x, y, txt)
      super
    end
  end

  test "Font dounderline function test 1" do
    pdf = MYPDF.new
    line = pdf.dounderline(10, 10, "test")
    assert_equal '28.35 812.94 19.34 -0.60 re f', line
  end

  test "Font dolinethrough function test 1" do
    pdf = MYPDF.new
    line = pdf.dolinethrough(10, 10, "test")
    assert_equal '28.35 816.94 19.34 -0.60 re f', line
  end

  test "Font dooverline function test 1" do
    pdf = MYPDF.new
    line = pdf.dooverline(10, 10, "test")
    assert_equal '28.35 824.34 19.34 -0.60 re f', line
  end
end