Sha256: 2afb6dd6f9802c86fc4b5eb7371465b90f93697692cd6137678ae0879bb9aed8

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

# coding: utf-8

require 'test_helper'

class Thinreports::Generator::TestPDF < Minitest::Test
  include Thinreports::TestHelper

  PDF = Thinreports::Generator::PDF

  def test_new_should_set_title_as_metadata
    report = Thinreports::Report.new layout: layout_file.path
    report.start_new_page

    actual_pdf_title = nil
    PDF::Document.define_singleton_method(:new) {|_options, meta|
      actual_pdf_title = meta[:Title]
    }
    PDF.new report, {}

    assert_equal 'Report Title', actual_pdf_title
  ensure
    PDF::Document.singleton_class.send(:remove_method, :new)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thinreports-0.9.1 test/unit/generator/test_pdf.rb
thinreports-0.9.0 test/unit/generator/test_pdf.rb