Class: ODDB::FiParse::TestFachinfoHpricotAlcaCDe

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



72
73
74
75
76
77
78
79
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 72

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

- (Object) test_amzv1



98
99
100
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 98

def test_amzv1
  assert_nil @writer.amzv
end

- (Object) test_company1



86
87
88
89
90
91
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 86

def test_company1
  ## 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('NOVARTIS CONSUMER HEALTH', chapter.heading)
end

- (Object) test_composition1



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 101

def test_composition1
  chapter = @fachinfo.composition
  assert_instance_of(ODDB::Text::Chapter, chapter )
  assert_equal('Zusammensetzung', chapter.heading)
  assert_equal(1, chapter.sections.size)
  section = chapter.sections.first
  assert_equal("", section.subheading)
  assert_equal(3, section.paragraphs.size)
  paragraph = section.paragraphs.at(0)
  expected =  "Wirkstoffe:"
  assert_equal(expected, paragraph.text)
  paragraph = section.paragraphs.at(1)
  expected =  /1 Brausetablette enth.*lt: Carbasalatum calcicum 528.*mg corresp. Acidum Acetylsalicylicum 415.*mg, Acidum ascorbicum 250.*mg./
  assert_match(expected, paragraph.text)
  paragraph = section.paragraphs.at(2)
  expected =  /Hilfsstoffe: Saccharinum, Cyclamas, Aromatica, Color.: E.*120\./
  assert_match(expected, paragraph.text)
end

- (Object) test_date1



169
170
171
172
173
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 169

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

- (Object) test_effects1



119
120
121
122
123
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 119

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

- (Object) test_fachinfo1



80
81
82
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 80

def test_fachinfo1
  assert_instance_of(FachinfoDocument, @fachinfo)
end

- (Object) test_galenic_form1



92
93
94
95
96
97
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 92

def test_galenic_form1
  chapter = @fachinfo.galenic_form
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Antipyretikum/Analgetikum mit Vitamin C', chapter.heading)
  assert_equal(0, chapter.sections.size)
end

- (Object) test_iksnrs1



164
165
166
167
168
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 164

def test_iksnrs1
  chapter = @fachinfo.iksnrs
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('IKS-Nummern', chapter.heading)
end

- (Object) test_indications1



129
130
131
132
133
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 129

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

- (Object) test_interactions1



149
150
151
152
153
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 149

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

- (Object) test_kinetic1



124
125
126
127
128
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 124

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

- (Object) test_name1



83
84
85
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 83

def test_name1
  assert_equal('Alca-C®', @fachinfo.name)
end

- (Object) test_other_advice1



159
160
161
162
163
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 159

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

- (Object) test_overdose1



154
155
156
157
158
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 154

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

- (Object) test_restrictions1



139
140
141
142
143
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 139

def test_restrictions1
  chapter = @fachinfo.restrictions
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_equal('Anwendungseinschränkungen', chapter.heading)
end

- (Object) test_unwanted_effects1



144
145
146
147
148
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 144

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

- (Object) test_usage1



134
135
136
137
138
# File 'ext/fiparse/test/test_fachinfo_hpricot.rb', line 134

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