Sha256: 6246933fdc99d94af5c52db9a284b23a3d1a0e24966ae111faab922aba447568

Contents?: true

Size: 764 Bytes

Versions: 21

Compression:

Stored size: 764 Bytes

Contents

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

require 'test_helper'
require 'hexapdf/font/encoding/base'

describe HexaPDF::Font::Encoding::Base do
  before do
    @base = HexaPDF::Font::Encoding::Base.new
    @base.code_to_name[65] = :A
  end

  it "returns nil for the encoding_name" do
    assert_nil(@base.encoding_name)
  end

  describe "name" do
    it "returns a mapped code" do
      assert_equal(:A, @base.name(65))
    end

    it "returns .notdef for an unmapped code" do
      assert_equal(:'.notdef', @base.name(66))
    end
  end

  describe "unicode" do
    it "returns the unicode value of the code" do
      assert_equal("A", @base.unicode(65))
    end

    it "returns an empty string for an unmapped code" do
      assert_nil(@base.unicode(66))
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hexapdf-0.12.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.9 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.8 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.7 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.6 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.5 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.4 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.3 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.2 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.1 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.11.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.10.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.9.3 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.9.2 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.9.1 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.9.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.8.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.7.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.6.0 test/hexapdf/font/encoding/test_base.rb
hexapdf-0.5.0 test/hexapdf/font/encoding/test_base.rb