Class: ODDB::FiParse::TestPatinfoHpricotInderalDe

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

Instance Method Summary collapse

Instance Method Details

#setupObject



462
463
464
465
466
467
468
469
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 462

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

#test_contra_indications3Object



473
474
475
476
477
478
479
480
481
482
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 473

def test_contra_indications3
  chapter = @writer.contra_indications
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Wann darf Inderal nicht angewendet werden?', 
               chapter.heading)
  assert_equal(1, chapter.sections.size)
  section = chapter.sections.first
  assert_equal("", section.subheading)
  assert_equal(3, section.paragraphs.size)
end

#test_galenic_form3Object



470
471
472
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 470

def test_galenic_form3
  assert_nil(@writer.galenic_form)
end

#test_precautions3Object



483
484
485
486
487
488
489
490
491
492
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 483

def test_precautions3
  chapter = @writer.precautions
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Wann ist bei der Einnahme von Inderal Vorsicht geboten?', 
               chapter.heading)
  assert_equal(1, chapter.sections.size)
  section = chapter.sections.first
  assert_equal("", section.subheading)
  assert_equal(12, section.paragraphs.size)
end

#test_pregnancy3Object



493
494
495
496
497
498
499
500
501
502
# File 'ext/fiparse/test/test_patinfo_hpricot.rb', line 493

def test_pregnancy3
  chapter = @writer.pregnancy
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Darf Inderal während einer Schwangerschaft oder in der Stillzeit eingenommen werden?', 
               chapter.heading)
  assert_equal(1, chapter.sections.size)
  section = chapter.sections.first
  assert_equal("", section.subheading)
  assert_equal(1, section.paragraphs.size)
end