Class: ODDB::FiParse::TestFachinfoHpricotPonstanDe

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

Instance Method Summary collapse

Instance Method Details

#setupObject



175
176
177
178
179
180
181
182
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 175

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

#test_amzv2Object



189
190
191
192
193
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 189

def test_amzv2
  chapter = @fachinfo.amzv
  assert_instance_of Text::Chapter, chapter
  assert_equal 'AMZV', chapter.heading
end

#test_company2Object



194
195
196
197
198
199
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 194

def test_company2
  ## this is unused. Since it's part of the base-class TextinfoHpricot, let's test it.
  chapter = @writer.company
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('PFIZER', chapter.heading)
end

#test_composition2Object



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 200

def test_composition2
  chapter = @fachinfo.composition
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Zusammensetzung', chapter.heading)
  assert_equal(2, chapter.sections.size)
  section = chapter.sections.first
  assert_equal("", section.subheading)
  assert_equal(1, section.paragraphs.size)
  paragraph = section.paragraphs.at(0)
  expected =  "Wirkstoff: Mefenaminsäure."
  assert_equal(expected, paragraph.text)
  section = chapter.sections.last
  assert_equal "Hilfsstoffe\n", section.subheading
  assert_equal(4, section.paragraphs.size)
  paragraph = section.paragraphs.at(0)
  expected =  "Filmtabletten: Vanillinum, Excipiens pro compresso obducto."
  assert_equal(expected, paragraph.text)
end

#test_contra_indications2Object



233
234
235
236
237
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 233

def test_contra_indications2
  chapter = @fachinfo.contra_indications
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Kontraindikationen', chapter.heading)
end

#test_date2Object



299
300
301
302
303
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 299

def test_date2
  chapter = @writer.date
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Stand der Information', chapter.heading)
end

#test_driving_ability2Object



253
254
255
256
257
258
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 253

def test_driving_ability2
  chapter = @fachinfo.driving_ability
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Wirkung auf die Fahrtüchtigkeit und auf das Bedienen von Maschinen',
               chapter.heading)
end

#test_effects2Object



269
270
271
272
273
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 269

def test_effects2
  chapter = @fachinfo.effects
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Eigenschaften/Wirkungen', chapter.heading)
end

#test_fachinfo2Object



183
184
185
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 183

def test_fachinfo2
  assert_instance_of(FachinfoDocument2001, @fachinfo)
end

#test_galenic_form2Object



218
219
220
221
222
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 218

def test_galenic_form2
  chapter = @fachinfo.galenic_form
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Galenische Form und Wirkstoffmenge pro Einheit', chapter.heading)
end

#test_iksnrs2Object



289
290
291
292
293
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 289

def test_iksnrs2
  chapter = @fachinfo.iksnrs
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Zulassungsnummer', chapter.heading)
end

#test_indications2Object



223
224
225
226
227
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 223

def test_indications2
  chapter = @fachinfo.indications
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Indikationen/Anwendungsmöglichkeiten', chapter.heading)
end

#test_interactions2Object



243
244
245
246
247
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 243

def test_interactions2
  chapter = @fachinfo.interactions
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Interaktionen', chapter.heading)
end

#test_kinetic2Object



274
275
276
277
278
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 274

def test_kinetic2
  chapter = @fachinfo.kinetic
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Pharmakokinetik', chapter.heading)
end

#test_name2Object



186
187
188
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 186

def test_name2
  assert_equal('Ponstan®', @fachinfo.name)
end

#test_other_advice2Object



284
285
286
287
288
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 284

def test_other_advice2
  chapter = @fachinfo.other_advice
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Sonstige Hinweise', chapter.heading)
end

#test_overdose2Object



264
265
266
267
268
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 264

def test_overdose2
  chapter = @fachinfo.overdose
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Überdosierung', chapter.heading)
end

#test_preclinic2Object



279
280
281
282
283
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 279

def test_preclinic2
  chapter = @fachinfo.preclinic
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Präklinische Daten', chapter.heading)
end

#test_pregnancy2Object



248
249
250
251
252
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 248

def test_pregnancy2
  chapter = @fachinfo.pregnancy
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Schwangerschaft/Stillzeit', chapter.heading)
end

#test_registration_owner2Object



294
295
296
297
298
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 294

def test_registration_owner2
  chapter = @fachinfo.registration_owner
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Zulassungsinhaberin', chapter.heading)
end

#test_restrictions2Object



238
239
240
241
242
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 238

def test_restrictions2
  chapter = @fachinfo.restrictions
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Warnhinweise und Vorsichtsmassnahmen', chapter.heading)
end

#test_unwanted_effects2Object



259
260
261
262
263
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 259

def test_unwanted_effects2
  chapter = @fachinfo.unwanted_effects
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Unerwünschte Wirkungen', chapter.heading)
end

#test_usage2Object



228
229
230
231
232
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 228

def test_usage2
  chapter = @fachinfo.usage
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Dosierung/Anwendung', chapter.heading)
end