Sha256: 129d0ad934954bc84dfa3b8f8ef489b1a64eb97b6f084c9c19ff1d5d47908de9

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 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 = new_report('layout_text1.tlf') {|r| r.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 'Basic Layout', actual_pdf_title
  ensure
    PDF::Document.singleton_class.send(:remove_method, :new)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.8.2 test/unit/generator/test_pdf.rb