test/unit/generator/test_pdf.rb in thinreports-0.8.2 vs test/unit/generator/test_pdf.rb in thinreports-0.9.0
- old
+ new
@@ -6,18 +6,19 @@
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 }
+ 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 'Basic Layout', actual_pdf_title
+ assert_equal 'Report Title', actual_pdf_title
ensure
PDF::Document.singleton_class.send(:remove_method, :new)
end
end