File: rbpdf_font_style_test.rb

package info (click to toggle)
ruby-rbpdf 1.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,252 kB
  • ctags: 704
  • sloc: ruby: 135,876; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 769 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
30
31
32
33
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 line, '28.35 812.94 19.34 -0.60 re f'
  end

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

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