Sha256: 360c411c9fcd80a2a38f062dbe5ac30c1be0221ee1ab2676c9e9336ea36ad8c9

Contents?: true

Size: 931 Bytes

Versions: 74

Compression:

Stored size: 931 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test_helper'
require 'hexapdf/font/invalid_glyph'

describe HexaPDF::Font::InvalidGlyph do
  before do
    font = Object.new
    font.define_singleton_method(:missing_glyph_id) { 0 }
    font.define_singleton_method(:full_name) { "Test Roman" }
    @glyph = HexaPDF::Font::InvalidGlyph.new(font, "str")
  end

  it "returns the missing glyph id for id/name" do
    assert_equal(0, @glyph.id)
    assert_equal(0, @glyph.name)
  end

  it "returns 0 for all glyph dimensions" do
    assert_equal(0, @glyph.x_min)
    assert_equal(0, @glyph.x_max)
    assert_equal(0, @glyph.y_min)
    assert_equal(0, @glyph.y_max)
  end

  it "doesn't allow the application of word spacing" do
    refute(@glyph.apply_word_spacing?)
  end

  it "can represent itself for debug purposes" do
    assert_equal('#<HexaPDF::Font::InvalidGlyph font="Test Roman" id=0 "str">',
                 @glyph.inspect)
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
hexapdf-0.34.1 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.34.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.33.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.32.2 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.32.1 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.32.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.31.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.30.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.29.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.28.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.27.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.26.2 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.26.1 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.26.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.25.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.24.2 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.24.1 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.24.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.23.0 test/hexapdf/font/test_invalid_glyph.rb
hexapdf-0.22.0 test/hexapdf/font/test_invalid_glyph.rb