Class: ODDB::FiParse::TestFachinfoPDFWriterFursol

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



1199
1200
1201
1202
1203
1204
1205
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1199

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

- (Object) test_correct_chapters



1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1220

def test_correct_chapters
  assert_equal("AMZV 9.11.2001", @fachinfo.amzv.heading)
  assert_equal("Zusammensetzung", @fachinfo.composition.heading)
  assert_equal("Galenische Form und Wirkstoffmenge pro Einheit",
    @fachinfo.galenic_form.heading)
  assert_equal("Indikationen/Anwendungsmöglichkeiten", 
    @fachinfo.indications.heading)
  assert_equal("Dosierung/Anwendung", @fachinfo.usage.heading)
  assert_equal("Kontraindikationen", 
    @fachinfo.contra_indications.heading)
  assert_equal("Warnhinweise und Vorsichtsmassnahmen", 
    @fachinfo.restrictions.heading)
  assert_equal("Interaktionen", @fachinfo.interactions.heading)
  assert_equal("Schwangerschaft/Stillzeit", 
    @fachinfo.pregnancy.heading)
  assert_equal("Wirkung auf die Fahrtüchtigkeit und auf das Bedienen von Maschinen", 
    @fachinfo.driving_ability.heading)
  assert_equal("Unerwünschte Wirkungen", 
    @fachinfo.unwanted_effects.heading)
  assert_equal("Überdosierung", @fachinfo.overdose.heading)
  assert_equal("Eigenschaften/Wirkungen", 
    @fachinfo.effects.heading)
  assert_equal("Pharmakokinetik", @fachinfo.kinetic.heading)
  assert_equal("Präklinische Daten", @fachinfo.preclinic.heading)
  assert_equal("Sonstige Hinweise", 
    @fachinfo.other_advice.heading)
  assert_equal("Zulassungsvermerk", @fachinfo.iksnrs.heading)
  assert_equal("Zulassungsinhaberin", 
    @fachinfo.registration_owner.heading)
  assert_equal("Stand der Information", @fachinfo.date.heading)
end

- (Object) test_linebreaks



1251
1252
1253
1254
1255
1256
1257
1258
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1251

def test_linebreaks
  chapter = @fachinfo.indications
  assert_equal(2, chapter.sections.size)
  section = chapter.sections.first
  assert_equal(4, section.paragraphs.size)
  section = chapter.sections.last
  assert_equal(8, section.paragraphs.size)
end

- (Object) test_no_page_numbers



1213
1214
1215
1216
1217
1218
1219
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1213

def test_no_page_numbers
  @fachinfo.each_chapter { |chapter|
    ch_str = chapter.to_s
    assert_nil(/seite \d+/i.match(ch_str), ch_str)
    assert_nil(/.*kompendium.*/i.match(ch_str), ch_str)
  }
end

- (Object) test_valid_until_fursol



1206
1207
1208
1209
1210
1211
1212
# File 'ext/fiparse/test/fachinfo_pdf_test.rb', line 1206

def test_valid_until_fursol
  chapter = @fachinfo.date
  assert_equal(1, chapter.sections.size, chapter.inspect)
  section = chapter.sections.first
  assert_equal(1, section.paragraphs.size, section.inspect)
  assert_equal("Dezember 2003.", section.to_s)
end