Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
rtf / test / test_header_node.rb
Size: Mime:
require File.expand_path(File.dirname(__FILE__)+'/helper_tests')

# Information class unit test class.
class HeaderNodeTest < Test::Unit::TestCase
   def setup
      @document = Document.new(Font.new(Font::ROMAN, 'Arial'))
   end

   def test_basics
      headers = []

      headers << HeaderNode.new(@document)
      headers << HeaderNode.new(@document, HeaderNode::LEFT_PAGE)

      assert(headers[0].parent == @document)
      assert(headers[1].parent == @document)

      assert(headers[0].type == HeaderNode::UNIVERSAL)
      assert(headers[1].type == HeaderNode::LEFT_PAGE)
   end

   def test_exceptions
      headers = HeaderNode.new(@document)
      begin
         headers.footnote("La la la.")
         flunk("Successfully added a footnote to a header.")
      rescue
      end
   end
end