Sha256: 8fcde055ad4f5940b88559890e03ee79532e9f9dcf573a80141a16a82e2e75f4

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

# coding: utf-8

require 'test/unit/helper'

class ThinReports::Generator::PDF::TestDocument < MiniTest::Unit::TestCase
  include ThinReports::TestHelpers
  
  # Alias
  Document = ThinReports::Generator::PDF::Document
  
  def test_new_without_page_creation
    pdf = Document.new
    assert_equal pdf.internal.page_count, 0
  end
  
  def test_new_with_zero_margin_canvas
    pdf = Document.new
    assert_equal pdf.internal.page.margins.values, [0, 0, 0, 0]
  end
  
  def test_new_with_security_settings
    flexmock(Prawn::Document).new_instances.
      should_receive(:encrypt_document).once.
      with(:user_password => 'foo')
    
    Document.new(:security => {:user_password => 'foo'})
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.7.7 test/unit/generator/pdf/test_document.rb
thinreports-0.7.6 test/unit/generator/pdf/test_document.rb
thinreports-0.7.5 test/unit/generator/pdf/test_document.rb
thinreports-0.7.0 test/unit/generator/pdf/test_document.rb