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

- (Object) setup



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

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

- (Object) test_amzv2



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

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

- (Object) test_company2



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

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

- (Object) test_composition2



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

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

- (Object) test_contra_indications2



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

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

- (Object) test_date2



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

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

- (Object) test_driving_ability2



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

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

- (Object) test_effects2



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

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

- (Object) test_fachinfo2



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

def test_fachinfo2
  assert_instance_of(FachinfoDocument2001, @fachinfo)
end

- (Object) test_galenic_form2



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

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

- (Object) test_iksnrs2



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

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

- (Object) test_indications2



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

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

- (Object) test_interactions2



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

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

- (Object) test_kinetic2



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

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

- (Object) test_name2



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

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

- (Object) test_other_advice2



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

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

- (Object) test_overdose2



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

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

- (Object) test_preclinic2



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

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

- (Object) test_pregnancy2



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

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

- (Object) test_registration_owner2



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

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

- (Object) test_restrictions2



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

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

- (Object) test_unwanted_effects2



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

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

- (Object) test_usage2



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

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