Sha256: 8752c9dd2a1bdea5b8dce3b377ad92648255f4179cd75e880f3e21479ffe39ca

Contents?: true

Size: 676 Bytes

Versions: 13

Compression:

Stored size: 676 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

13 entries across 13 versions & 1 rubygems

Version Path
hexapdf-0.10.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.9.3 test/hexapdf/type/test_catalog.rb
hexapdf-0.9.2 test/hexapdf/type/test_catalog.rb
hexapdf-0.9.1 test/hexapdf/type/test_catalog.rb
hexapdf-0.9.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.8.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.7.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.6.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.5.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.4.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.3.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.2.0 test/hexapdf/type/test_catalog.rb
hexapdf-0.1.0 test/hexapdf/type/test_catalog.rb