Sha256: 3f2029ab66e10911b0d834bdd0040dc0de0ba53c840bb237f5d7f0ebe158b10f

Contents?: true

Size: 944 Bytes

Versions: 6

Compression:

Stored size: 944 Bytes

Contents

require_relative 'helper'


class TestFont < Test::Unit::TestCase

  P = Processing

  def font(*args)
    P::Font.new(Rays::Font.new(*args)).tap {|font|
      def font.intern()
        getInternal__
      end
    }
  end

  def test_initialize()
    assert_not_nil        font(nil)    .intern.name
    assert_equal 'Arial', font('Arial').intern.name

    assert_equal 12, font         .intern.size
    assert_equal 10, font(nil, 10).intern.size
  end

  def test_size()
    f  = font nil, 10
    id = f.intern.object_id

    assert_equal 10, f.intern.size

    f.setSize__ 11
    assert_equal 11, f.intern.size
    assert_not_equal id, f.intern.object_id

    f.setSize__ 10
    assert_equal 10, f.intern.size
    assert_equal id, f.intern.object_id
  end

  def test_inspect()
    assert_match %r|#<Processing::Font: name:'[\w\s]+' size:[\d\.]+>|, font.inspect
  end

  def test_list()
    assert_not P::Font.list.empty?
  end

end# TestFont

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
processing-1.1 test/test_font.rb
processing-1.0.3 test/test_font.rb
processing-1.0.2 test/test_font.rb
processing-1.0.1 test/test_font.rb
processing-0.5.34 test/test_font.rb
processing-0.5.33 test/test_font.rb