Sha256: a0f18ed79849715decce8a43117cb0848a445706bc52b7291a8f5ec1ace3a1c7

Contents?: true

Size: 678 Bytes

Versions: 10

Compression:

Stored size: 678 Bytes

Contents

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

require 'test_helper'
require 'hexapdf/document'
require 'hexapdf/type/catalog'

describe HexaPDF::Type::Catalog do
  before do
    @doc = HexaPDF::Document.new
    @catalog = @doc.add({Type: :Catalog})
  end

  it "must always be indirect" do
    @catalog.must_be_indirect = false
    assert(@catalog.must_be_indirect?)
  end

  it "creates the page tree on access" do
    assert_nil(@catalog[:Pages])
    pages = @catalog.pages
    assert_equal(:Pages, pages.type)
  end

  describe "validation" do
    it "creates the page tree if necessary" do
      refute(@catalog.validate(auto_correct: false))
      assert(@catalog.validate)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hexapdf-0.11.9 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.8 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.7 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.6 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.5 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.4 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.3 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.2 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.1 test/hexapdf/type/test_catalog.rb
hexapdf-0.11.0 test/hexapdf/type/test_catalog.rb