Class: ODDB::FiParse::TestPatinfoHpricotNasivinDe

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



548
549
550
551
552
553
554
555
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 548

def setup
  @path = File.expand_path('data/html/de/nasivin.html', 
    File.dirname(__FILE__))
  @writer = PatinfoHpricot.new
  open(@path) { |fh| 
    @patinfo = @writer.extract(Hpricot(fh))
  }
end

- (Object) test_composition5



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 556

def test_composition5
  chapter = @writer.effects
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Was ist Nasivin und wann wird es angewendet?', chapter.heading)
  section = chapter.sections.first
  assert_instance_of(ODDB::Text::Section, section )
  assert_equal('', section.subheading)
  chapter = @writer.composition
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Was ist in Nasivin enthalten?', chapter.heading)
  chapter = @writer.packages
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Wo erhalten Sie Nasivin? Welche Packungen sind erhältlich?', chapter.heading)
  section = chapter.sections.first
  paragraph = section.paragraphs.first
  assert_instance_of(ODDB::Text::Paragraph, paragraph )
  assert_equal("In Apotheken und Drogerien ohne ärztliche Verschreibung.", 
               paragraph.text)
  chapter = @writer.date
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('', chapter.heading)
  section = chapter.sections.first
  assert_instance_of(ODDB::Text::Section, section )
  assert_equal("", section.subheading)
  assert_equal(1, section.paragraphs.size)
  assert_equal("Diese Packungsbeilage wurde im März 2007 letztmals durch die Arzneimittelbehörde (Swissmedic) geprüft.", section.to_s)
   

end