Class: ODDB::FiParse::TestFachinfoPDFHBVAXPRO

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
ext/fiparse/test/fachinfo_pdf_test.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



1495
1496
1497
1498
1499
1500
1501
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1495

def setup
  @writer = FachinfoPDFWriter.new
  path = File.expand_path('../test/data/method_calls_hbvaxpro.rb',
    File.dirname(__FILE__))
  eval(File.read(path))
  @fachinfo = @writer.to_fachinfo
end

- (Object) test_first_paragraph_is_preformatted



1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1502

def test_first_paragraph_is_preformatted
  chapter = @fachinfo.composition
  assert_equal(1, chapter.sections.size)
  section = chapter.sections.at(0)
  expected = "Eine Impfdosis"
  assert_equal(expected, section.subheading.to_s)
  paragraph = section.paragraphs.at(0)
  assert_equal(2, section.paragraphs.size)
  expected = ""
  lines = paragraph.to_s.split(/\n/)
  expected.split(/\n/).each_with_index { |line, idx|
    assert_not_nil(lines[idx], line)
    assert_equal(line.rstrip, lines[idx].rstrip)
  }
end