Sha256: f58a575cd71c6d33106cfd0f8c0d5d609ee05a13a2cf2a54886c97bd159b4689

Contents?: true

Size: 548 Bytes

Versions: 13

Compression:

Stored size: 548 Bytes

Contents

# -*- coding: utf-8 -*-


require_relative 'helper'


class TestFont < Test::Unit::TestCase

  def font(*args)
    Rays::Font.new(*args)
  end

  def test_name()
    assert_kind_of String, font.name
  end

  def test_size()
    assert_kind_of Numeric, font.size
    assert_equal 32, font(nil, 32).size
  end

  def test_width()
    assert_equal 0, font.width('')
    w = font.width 'X'
    assert_equal w * 2, font.width('XX')
  end

  def test_height()
    f = font
    assert_equal f.height, f.ascent + f.descent + f.leading
  end

end# TestFont

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rays-0.1.34 test/test_font.rb
rays-0.1.33 test/test_font.rb
rays-0.1.32 test/test_font.rb
rays-0.1.31 test/test_font.rb
rays-0.1.30 test/test_font.rb
rays-0.1.29 test/test_font.rb
rays-0.1.28 test/test_font.rb
rays-0.1.27 test/test_font.rb
rays-0.1.26 test/test_font.rb
rays-0.1.25 test/test_font.rb
rays-0.1.24 test/test_font.rb
rays-0.1.23 test/test_font.rb
rays-0.1.22 test/test_font.rb