Sha256: a4246f7cacc33f54af673a5e04d608ba44ee497fc13c190e461d021e4a8ea836

Contents?: true

Size: 759 Bytes

Versions: 1

Compression:

Stored size: 759 Bytes

Contents

# coding: utf-8

require 'test/unit/helper'

class ThinReports::Generator::TestPDF < MiniTest::Unit::TestCase
  include ThinReports::TestHelpers
  
  # Alias
  PDF = ThinReports::Generator::PDF
  
  def test_new_should_set_empty_title_when_the_default_layout_is_not_set
    report = ThinReports::Report.new
    report.start_new_page :layout => data_file('basic_layout1.tlf')

    flexmock(PDF::Document).should_receive(:new).
      with(Hash, :Title => nil).once

    PDF.new(report, {})
  end

  def test_new_should_set_title_as_metadata
    report = create_basic_report('basic_layout1.tlf') {|r| r.start_new_page }
    
    flexmock(PDF::Document).should_receive(:new).
      with(Hash, :Title => 'Basic Layout').once
    
    PDF.new(report, {})
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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