raakt 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/raakt.rb +346 -274
- data/tests/areadoc1.htm +12 -0
- data/tests/areadoc2.htm +12 -0
- data/tests/areadoc3.htm +12 -0
- data/tests/bdoc.htm +9 -0
- data/tests/charset_nocharset_specified.htm +8 -0
- data/tests/charset_utf8.htm +9 -0
- data/tests/embeddoc1.htm +9 -0
- data/tests/formdoc1.htm +14 -0
- data/tests/formdoc2.htm +15 -0
- data/tests/formdoc3.htm +22 -0
- data/tests/full_berg.htm +441 -0
- data/tests/inputimgdoc1.htm +14 -0
- data/tests/langinfodoc2.htm +8 -0
- data/tests/nestedtabledoc.htm +205 -0
- data/tests/raakt_test.rb +204 -144
- metadata +21 -7
- data/lib/raakt (kopia).rb +0 -495
data/tests/raakt_test.rb
CHANGED
@@ -1,83 +1,122 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper'
|
2
2
|
require File.dirname(__FILE__) + '/../lib/raakt'
|
3
|
-
require 'rubyful_soup'
|
4
3
|
|
5
4
|
class RaaktTest < Test::Unit::TestCase
|
6
5
|
|
7
6
|
def setup
|
8
7
|
@raakt = Raakt::Test.new
|
9
|
-
|
10
|
-
#Use includeremote option to run unit tests that fetch test data from http://raakt.rubyforge.org
|
11
|
-
@remote_tests = false
|
12
|
-
if ARGV[0] == "includeremote"
|
13
|
-
@remote_tests = true
|
14
|
-
end
|
15
8
|
end
|
16
9
|
|
17
10
|
def test_all
|
18
|
-
@raakt.
|
19
|
-
assert_equal
|
11
|
+
@raakt.doc = data_full_google
|
12
|
+
assert_equal 7, @raakt.all.length
|
20
13
|
end
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
|
15
|
+
def test_check_fieldset_legend
|
16
|
+
@raakt.doc = data_formdoc1
|
17
|
+
assert_equal 1, @raakt.check_fieldset_legend.length
|
18
|
+
|
19
|
+
@raakt.doc = data_formdoc2
|
20
|
+
assert_equal 0, @raakt.check_fieldset_legend.length
|
21
|
+
|
22
|
+
@raakt.doc = data_formdoc3
|
23
|
+
assert_equal 2, @raakt.check_fieldset_legend.length
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_check_embed
|
27
|
+
@raakt.doc = data_embeddoc1
|
28
|
+
assert_equal 1, @raakt.check_embed.length
|
29
|
+
|
30
|
+
@raakt.doc = data_empty
|
31
|
+
assert_equal 0, @raakt.check_embed.length
|
32
32
|
end
|
33
33
|
|
34
|
+
def test_check_character_set
|
35
|
+
@raakt.doc = data_charset_utf8
|
36
|
+
test_headers = {"Content-Type" => "text/html; charset=ISO-8859-1"}
|
37
|
+
@raakt.headers = test_headers
|
38
|
+
assert_equal 1, @raakt.check_character_set.length
|
39
|
+
|
40
|
+
@raakt.doc = data_charset_utf8
|
41
|
+
test_headers = {"Content-Type" => "text/html; charset=utf-8"}
|
42
|
+
@raakt.headers = test_headers
|
43
|
+
assert_equal 0, @raakt.check_character_set.length
|
44
|
+
|
45
|
+
@raakt.doc = data_charset_nocharset_specified
|
46
|
+
@raakt.headers = nil
|
47
|
+
assert_equal 0, @raakt.check_character_set.length
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
def test_check_input_type_img
|
52
|
+
@raakt.doc = data_inputimgdoc1
|
53
|
+
assert_equal 2, @raakt.check_input_type_img.length
|
54
|
+
assert_equal "1the_name", @raakt.check_input_type_img[0].note
|
55
|
+
assert_equal "3the_id", @raakt.check_input_type_img[1].note
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
def test_check_areas
|
60
|
+
@raakt.doc = data_areadoc1
|
61
|
+
assert_equal 1, @raakt.check_areas.length
|
62
|
+
assert_equal :missing_area_alt, @raakt.check_areas[0].eid
|
63
|
+
|
64
|
+
@raakt.doc = data_areadoc2
|
65
|
+
assert_equal 0, @raakt.check_areas.length
|
66
|
+
|
67
|
+
@raakt.doc = data_areadoc3
|
68
|
+
assert_equal 1, @raakt.check_areas.length
|
69
|
+
assert_equal :missing_area_alt_text, @raakt.check_areas[0].eid
|
70
|
+
end
|
34
71
|
|
72
|
+
|
35
73
|
def test_check_images
|
36
|
-
@raakt.
|
74
|
+
@raakt.doc = data_imagedoc1
|
37
75
|
assert_equal 1, @raakt.check_images.length
|
38
|
-
assert_equal
|
76
|
+
assert_equal :missing_alt, @raakt.check_images[0].eid
|
39
77
|
|
40
|
-
@raakt.
|
78
|
+
@raakt.doc = data_imagedoc2
|
41
79
|
assert_equal 0, @raakt.check_images.length
|
42
80
|
|
43
|
-
@raakt.
|
81
|
+
@raakt.doc = data_imagedoc3
|
44
82
|
assert_equal 3, @raakt.check_images.length
|
45
83
|
|
46
|
-
@raakt.
|
84
|
+
@raakt.doc = data_imagedoc4
|
47
85
|
assert_equal 1, @raakt.check_images.length
|
48
86
|
end
|
49
87
|
|
88
|
+
|
50
89
|
def test_check_images_in_blank_doc
|
51
|
-
@raakt.
|
90
|
+
@raakt.doc = data_empty
|
52
91
|
assert_equal 0, @raakt.check_images.length
|
53
92
|
end
|
54
93
|
|
55
94
|
|
56
95
|
def test_check_title
|
57
|
-
@raakt.
|
96
|
+
@raakt.doc = data_xhtmldoc1
|
58
97
|
assert_equal 0, @raakt.check_title.length
|
59
98
|
|
60
|
-
@raakt.
|
99
|
+
@raakt.doc = data_empty
|
61
100
|
assert_equal 1, @raakt.check_title.length
|
62
|
-
assert_equal
|
101
|
+
assert_equal :missing_title, @raakt.check_title[0].eid
|
63
102
|
|
64
|
-
@raakt.
|
103
|
+
@raakt.doc = data_emptytitledoc
|
65
104
|
assert_equal 1, @raakt.check_title.length
|
66
|
-
assert_equal
|
105
|
+
assert_equal :empty_title, @raakt.check_title[0].eid
|
67
106
|
|
68
|
-
@raakt.
|
107
|
+
@raakt.doc = data_invalidhtmldoc1
|
69
108
|
assert_equal 0, @raakt.check_title.length
|
70
109
|
|
71
|
-
@raakt.
|
110
|
+
@raakt.doc = data_invalidhtmldoc2
|
72
111
|
assert_equal 0, @raakt.check_title.length
|
73
112
|
end
|
74
113
|
|
75
114
|
|
76
115
|
def test_headings
|
77
|
-
@raakt.
|
116
|
+
@raakt.doc = data_headingsdoc1
|
78
117
|
assert_equal 3, @raakt.headings.length
|
79
118
|
|
80
|
-
@raakt.
|
119
|
+
@raakt.doc = data_invalidhtmldoc2
|
81
120
|
assert_equal 0, @raakt.headings.length
|
82
121
|
end
|
83
122
|
|
@@ -91,139 +130,165 @@ class RaaktTest < Test::Unit::TestCase
|
|
91
130
|
|
92
131
|
|
93
132
|
def test_check_has_heading
|
94
|
-
@raakt.
|
133
|
+
@raakt.doc = data_empty
|
95
134
|
assert_equal 1, @raakt.check_has_heading.length
|
96
|
-
assert_equal
|
97
|
-
|
98
|
-
@raakt.feed(data_headingsdoc1)
|
99
|
-
assert_equal 0, @raakt.check_has_heading.length
|
135
|
+
assert_equal :missing_heading, @raakt.check_has_heading[0].eid
|
100
136
|
|
101
|
-
@raakt.
|
137
|
+
@raakt.doc = data_headingsdoc1
|
102
138
|
assert_equal 0, @raakt.check_has_heading.length
|
103
139
|
|
104
|
-
|
140
|
+
# This now works thanks to hpricot.
|
141
|
+
@raakt.doc = data_headingsdoc9
|
142
|
+
assert_equal 1, @raakt.check_has_heading.length
|
143
|
+
assert_equal :missing_heading, @raakt.check_has_heading[0].eid
|
144
|
+
|
145
|
+
|
146
|
+
@raakt.doc = data_invalidhtmldoc2
|
105
147
|
assert_equal 1, @raakt.check_has_heading.length
|
106
|
-
assert_equal
|
148
|
+
assert_equal :missing_heading, @raakt.check_has_heading[0].eid
|
107
149
|
end
|
108
150
|
|
109
151
|
|
110
152
|
def test_check_document_structure
|
111
153
|
|
112
|
-
@raakt.
|
154
|
+
@raakt.doc = data_headingsdoc1
|
113
155
|
assert_equal 0, @raakt.check_document_structure.length
|
114
156
|
|
115
|
-
@raakt.
|
157
|
+
@raakt.doc = data_headingsdoc3
|
116
158
|
assert_equal 1, @raakt.check_document_structure.length
|
117
|
-
assert_equal
|
159
|
+
assert_equal :first_h_not_h1, @raakt.check_document_structure[0].eid
|
118
160
|
|
119
|
-
@raakt.
|
120
|
-
assert_equal
|
161
|
+
@raakt.doc = data_headingsdoc4
|
162
|
+
assert_equal :wrong_h_structure, @raakt.check_document_structure[0].eid
|
121
163
|
|
122
|
-
@raakt.
|
123
|
-
assert_equal
|
124
|
-
assert_equal
|
164
|
+
@raakt.doc = data_headingsdoc5
|
165
|
+
assert_equal :first_h_not_h1, @raakt.check_document_structure[0].eid
|
166
|
+
assert_equal :wrong_h_structure, @raakt.check_document_structure[1].eid
|
125
167
|
|
126
|
-
@raakt.
|
168
|
+
@raakt.doc = data_headingsdoc6
|
127
169
|
assert_equal 0, @raakt.check_document_structure.length
|
128
170
|
|
129
|
-
@raakt.
|
171
|
+
@raakt.doc = data_empty
|
130
172
|
assert_equal 0, @raakt.check_document_structure.length
|
131
173
|
end
|
132
174
|
|
133
175
|
|
134
176
|
def test_check_for_nested_tables
|
135
|
-
@raakt.
|
177
|
+
@raakt.doc = data_tabledoc1
|
136
178
|
assert_equal 0, @raakt.check_for_nested_tables.length
|
137
179
|
|
138
|
-
@raakt.
|
180
|
+
@raakt.doc = data_tabledoc2
|
139
181
|
assert_equal 0, @raakt.check_for_nested_tables.length
|
140
182
|
|
141
|
-
@raakt.
|
183
|
+
@raakt.doc = data_tabledoc3
|
142
184
|
assert_equal 1, @raakt.check_for_nested_tables.length
|
143
|
-
assert_equal
|
144
|
-
|
145
|
-
@raakt.
|
185
|
+
assert_equal :has_nested_tables, @raakt.check_for_nested_tables[0].eid
|
186
|
+
|
187
|
+
@raakt.doc = data_tabledoc4
|
146
188
|
assert_equal 0, @raakt.check_for_nested_tables.length
|
147
189
|
|
148
|
-
@raakt.
|
190
|
+
@raakt.doc = data_tabledoc5
|
149
191
|
assert_equal 1, @raakt.check_for_nested_tables.length
|
192
|
+
|
193
|
+
@raakt.doc = data_nestedtabledoc
|
194
|
+
assert_equal 1, @raakt.check_for_nested_tables.length
|
150
195
|
end
|
151
196
|
|
152
197
|
|
153
198
|
def test_check_tables
|
154
|
-
@raakt.
|
199
|
+
@raakt.doc = data_tabledoc4
|
155
200
|
assert_equal 0, @raakt.check_tables.length
|
156
201
|
|
157
|
-
@raakt.
|
202
|
+
@raakt.doc = data_tabledoc1
|
158
203
|
assert_equal 0, @raakt.check_tables.length
|
159
204
|
|
160
|
-
@raakt.
|
205
|
+
@raakt.doc = data_tabledoc2
|
161
206
|
assert_equal 2, @raakt.check_tables.length
|
162
|
-
end
|
163
207
|
|
208
|
+
# More accurate count here due to hpricot
|
209
|
+
@raakt.doc = data_full_berg
|
210
|
+
assert_equal 21, @raakt.check_tables.length
|
211
|
+
end
|
164
212
|
|
165
213
|
def test_check_for_formatting_elements
|
166
|
-
@raakt.
|
167
|
-
|
168
|
-
|
214
|
+
@raakt.doc = data_invalidelements1
|
215
|
+
invaliderrs = @raakt.check_for_formatting_elements
|
216
|
+
|
217
|
+
assert_equal 2, invaliderrs.length
|
218
|
+
assert_equal :missing_semantics, invaliderrs[0].eid
|
219
|
+
assert_equal :has_flicker, invaliderrs[1].eid
|
220
|
+
|
221
|
+
@raakt.doc = data_xhtmldoc1
|
222
|
+
assert_equal 0, @raakt.check_for_formatting_elements.length
|
169
223
|
end
|
224
|
+
|
170
225
|
|
171
226
|
|
172
227
|
def test_check_for_language_info
|
173
|
-
@raakt.
|
228
|
+
@raakt.doc = data_xhtmldoc1
|
174
229
|
assert_equal 0, @raakt.check_for_language_info.length
|
175
230
|
|
176
|
-
@raakt.
|
231
|
+
@raakt.doc = data_tabledoc2
|
177
232
|
assert_equal 1, @raakt.check_for_language_info.length
|
178
233
|
|
179
|
-
@raakt.
|
234
|
+
@raakt.doc = data_tablelayoutdoc
|
180
235
|
assert_equal 1, @raakt.check_for_language_info.length
|
181
236
|
|
182
|
-
@raakt.
|
237
|
+
@raakt.doc = data_langinfodoc1
|
183
238
|
assert_equal 0, @raakt.check_for_language_info.length
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
239
|
+
|
240
|
+
@raakt.doc = data_langinfodoc2
|
241
|
+
assert_equal 1, @raakt.check_for_language_info.length
|
242
|
+
end
|
243
|
+
|
244
|
+
|
245
|
+
def test_check_valid_language_code
|
246
|
+
@raakt.doc = data_langinfodoc1
|
247
|
+
assert_equal 0, @raakt.check_valid_language_code.length
|
248
|
+
|
249
|
+
@raakt.doc = data_empty
|
250
|
+
assert_equal 0, @raakt.check_valid_language_code.length
|
251
|
+
|
252
|
+
@raakt.doc = data_xhtmldoc1
|
253
|
+
assert_equal 0, @raakt.check_valid_language_code.length
|
192
254
|
end
|
193
255
|
|
194
256
|
|
195
257
|
def test_check_link_text
|
196
|
-
@raakt.
|
258
|
+
@raakt.doc = data_linkdoc1
|
197
259
|
assert_equal 1, @raakt.check_link_text.length
|
198
|
-
assert_equal
|
260
|
+
assert_equal :ambiguous_link_text, @raakt.check_link_text[0].eid
|
199
261
|
|
200
|
-
@raakt.
|
262
|
+
@raakt.doc = data_linkdoc3
|
201
263
|
assert_equal 0, @raakt.check_link_text.length
|
202
264
|
|
203
|
-
@raakt.
|
265
|
+
@raakt.doc = data_linkdoc2
|
204
266
|
assert_equal 0, @raakt.check_link_text.length
|
205
267
|
|
206
|
-
@raakt.
|
268
|
+
@raakt.doc = data_linkdoc4
|
207
269
|
assert_equal 1, @raakt.check_link_text.length
|
208
270
|
end
|
209
271
|
|
210
272
|
|
211
273
|
def test_get_links
|
212
|
-
@raakt.
|
274
|
+
@raakt.doc = data_linkdoc1
|
213
275
|
assert_equal 8, @raakt.get_links.length
|
214
276
|
|
215
|
-
@raakt.
|
277
|
+
@raakt.doc = data_linkdoc4
|
216
278
|
assert_equal 2, @raakt.get_links.length
|
217
|
-
assert_equal "Read more", @raakt.get_links[0]
|
279
|
+
assert_equal "Read more", @raakt.get_link_text(@raakt.get_links[0])
|
218
280
|
end
|
219
281
|
|
220
|
-
def
|
221
|
-
|
282
|
+
def test_alt_to_text
|
283
|
+
element = Hpricot("<img src='123' alt='Read more' />").at('img')
|
284
|
+
assert_equal "Read more", @raakt.alt_to_text(element)
|
222
285
|
end
|
223
286
|
|
224
287
|
def test_elements_to_text
|
225
|
-
|
226
|
-
assert_equal "
|
288
|
+
element = Hpricot("<a href='rrr'>Read <img src='123' alt='more' /> about</a>").at('a')
|
289
|
+
assert_equal "Read more about", @raakt.elements_to_text(element)
|
290
|
+
element2 = Hpricot("<a href='r'><strong><i>A</i></strong> sample <img src='123' alt='text' /> <b>here</b></a>").at('a')
|
291
|
+
assert_equal "A sample text here", @raakt.elements_to_text(element2)
|
227
292
|
end
|
228
293
|
|
229
294
|
def test_normalize_text
|
@@ -233,124 +298,119 @@ class RaaktTest < Test::Unit::TestCase
|
|
233
298
|
assert_equal "Read more", @raakt.normalize_text("Read more")
|
234
299
|
assert_equal "Read more", @raakt.normalize_text("Read more")
|
235
300
|
assert_equal "Read more", @raakt.normalize_text("Read\n more")
|
236
|
-
assert_equal "
|
237
|
-
assert_equal "
|
301
|
+
assert_equal "Läs mer", @raakt.normalize_text("Läs\n mer")
|
302
|
+
assert_equal "Läs mer", @raakt.normalize_text("Läs \nmer")
|
238
303
|
assert_equal "Read more", @raakt.normalize_text("Read \n\n\nmore")
|
239
304
|
assert_equal "Read more", @raakt.normalize_text("Read \tmore")
|
240
305
|
assert_equal "Read more", @raakt.normalize_text(" Read more")
|
241
306
|
end
|
242
307
|
|
243
308
|
def test_is_ambiguous_link
|
244
|
-
link_a =
|
245
|
-
link_b =
|
309
|
+
link_a = Hpricot("<a href='/news/1'>Read more</a>").at('a')
|
310
|
+
link_b = Hpricot("<a href='/news/2'>Read more</a>").at('a')
|
246
311
|
assert_equal true, @raakt.is_ambiguous_link(link_a, link_b)
|
247
312
|
|
248
|
-
link_c =
|
249
|
-
link_d =
|
313
|
+
link_c = Hpricot("<a href='/news/1' title='More about first news item'>Read more</a>").at('a')
|
314
|
+
link_d = Hpricot("<a href='/news/2' title='More about second news item'>Read more</a>").at('a')
|
250
315
|
assert_equal false, @raakt.is_ambiguous_link(link_c, link_d)
|
251
|
-
|
252
|
-
link_a = [1, "/news/1", nil, "Read more"]
|
253
|
-
link_b = [2, "/news/2", nil, "Read more"]
|
254
|
-
assert_equal true, @raakt.is_ambiguous_link(link_a, link_b)
|
255
316
|
|
256
|
-
|
257
|
-
|
258
|
-
assert_equal false, @raakt.is_ambiguous_link(
|
317
|
+
link_e = Hpricot("<a href='/news/1'>Read more</a>").at('a')
|
318
|
+
link_f = Hpricot("<a href='/news/1'>Read more</a>").at('a')
|
319
|
+
assert_equal false, @raakt.is_ambiguous_link(link_e, link_f)
|
259
320
|
|
260
|
-
|
261
|
-
|
262
|
-
assert_equal true, @raakt.is_ambiguous_link(
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
assert_equal true, @raakt.is_ambiguous_link(
|
321
|
+
link_g = Hpricot("<a href='/news/1'>Läs mer</a>").at('a')
|
322
|
+
link_h = Hpricot("<a href='/news/2'>Läs\n mer</a>").at('a')
|
323
|
+
assert_equal true, @raakt.is_ambiguous_link(link_g, link_h)
|
324
|
+
|
325
|
+
link_i = Hpricot("<a href='/news/1'>Läs mer</a>").at('a')
|
326
|
+
link_j = Hpricot("<a href='/news/2'>Läs \nmer</a>").at('a')
|
327
|
+
assert_equal true, @raakt.is_ambiguous_link(link_i, link_j)
|
267
328
|
end
|
268
329
|
|
269
330
|
|
270
331
|
def test_get_labels
|
271
|
-
@raakt.
|
332
|
+
@raakt.doc = data_fielddoc1
|
272
333
|
assert_equal 1, @raakt.get_labels.length
|
273
334
|
|
274
|
-
@raakt.
|
335
|
+
@raakt.doc = data_fielddoc2
|
275
336
|
assert_equal 1, @raakt.get_labels.length
|
276
337
|
|
277
|
-
@raakt.
|
338
|
+
@raakt.doc = data_fielddoc3
|
278
339
|
assert_equal 2, @raakt.get_labels.length
|
279
340
|
end
|
280
341
|
|
281
342
|
|
282
343
|
def test_get_editable_fields
|
283
|
-
@raakt.
|
344
|
+
@raakt.doc = data_fielddoc1
|
284
345
|
assert_equal 1, @raakt.get_editable_fields.length
|
285
346
|
|
286
|
-
@raakt.
|
347
|
+
@raakt.doc = data_fielddoc2
|
287
348
|
assert_equal 2, @raakt.get_editable_fields.length
|
288
349
|
|
289
|
-
@raakt.
|
350
|
+
@raakt.doc = data_fielddoc3
|
290
351
|
assert_equal 3, @raakt.get_editable_fields.length
|
291
352
|
end
|
292
353
|
|
293
354
|
|
294
355
|
def test_check_form
|
295
|
-
@raakt.
|
356
|
+
@raakt.doc = data_fielddoc1
|
296
357
|
assert_equal 0, @raakt.check_form.length
|
297
358
|
|
298
|
-
@raakt.
|
359
|
+
@raakt.doc = data_fielddoc2
|
299
360
|
assert_equal 1, @raakt.check_form.length
|
300
|
-
assert_equal
|
361
|
+
assert_equal :field_missing_label, @raakt.check_form[0].eid
|
301
362
|
|
302
|
-
@raakt.
|
363
|
+
@raakt.doc = data_fielddoc3
|
303
364
|
assert_equal 1, @raakt.check_form.length
|
304
|
-
assert_equal
|
365
|
+
assert_equal :field_missing_label, @raakt.check_form[0].eid
|
305
366
|
end
|
306
367
|
|
307
368
|
|
308
369
|
def test_is_frameset
|
309
|
-
@raakt.
|
370
|
+
@raakt.doc = data_framedoc1
|
310
371
|
assert @raakt.is_frameset
|
311
372
|
|
312
|
-
@raakt.
|
373
|
+
@raakt.doc = data_framedoc2
|
313
374
|
assert @raakt.is_frameset
|
314
375
|
|
315
|
-
@raakt.
|
376
|
+
@raakt.doc = data_xhtmldoc1
|
316
377
|
assert !@raakt.is_frameset
|
317
378
|
end
|
318
379
|
|
319
380
|
|
320
381
|
def test_check_frames
|
321
|
-
@raakt.
|
382
|
+
@raakt.doc = data_framedoc1
|
322
383
|
assert_equal 3, @raakt.check_frames.length
|
323
384
|
|
324
|
-
@raakt.
|
385
|
+
@raakt.doc = data_framedoc2
|
325
386
|
assert_equal 0, @raakt.check_frames.length
|
326
387
|
end
|
327
388
|
|
328
389
|
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
assert_equal 0, @raakt.check_for_formatting_elements.length
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
def test_use_ignore_bi_setting
|
394
|
+
@raakt.ignore_bi = true
|
395
|
+
@raakt.doc = data_bdoc
|
396
|
+
assert_equal 0, @raakt.check_for_formatting_elements.length
|
397
|
+
@raakt.ignore_bi = false
|
398
|
+
assert_equal 1, @raakt.check_for_formatting_elements.length
|
339
399
|
end
|
340
|
-
|
341
|
-
|
400
|
+
|
401
|
+
|
342
402
|
def test_refresh
|
343
|
-
@raakt.
|
403
|
+
@raakt.doc = data_metarefreshdoc1
|
344
404
|
assert_equal 1, @raakt.check_refresh.length
|
345
405
|
|
346
|
-
@raakt.
|
406
|
+
@raakt.doc = data_metarefreshdoc2
|
347
407
|
assert_equal 1, @raakt.check_refresh.length
|
348
408
|
|
349
|
-
@raakt.
|
409
|
+
@raakt.doc = data_metarefreshdoc3
|
350
410
|
assert_equal 1, @raakt.check_refresh.length
|
351
411
|
|
352
|
-
@raakt.
|
412
|
+
@raakt.doc = data_xhtmldoc1
|
353
413
|
assert_equal 0, @raakt.check_refresh.length
|
354
414
|
end
|
355
415
|
|
356
|
-
end
|
416
|
+
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: raakt
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date:
|
6
|
+
version: "0.5"
|
7
|
+
date: 2007-02-28 00:00:00 +01:00
|
8
8
|
summary: A toolkit to find accessibility issues in HTML documents.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -15,7 +15,7 @@ description:
|
|
15
15
|
autorequire: raakt
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
|
-
has_rdoc:
|
18
|
+
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
@@ -25,19 +25,30 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- Peter Krantz
|
30
31
|
files:
|
31
|
-
- lib/raakt (kopia).rb
|
32
32
|
- lib/raakt.rb
|
33
|
+
- tests/areadoc1.htm
|
34
|
+
- tests/areadoc2.htm
|
35
|
+
- tests/areadoc3.htm
|
36
|
+
- tests/bdoc.htm
|
37
|
+
- tests/charset_nocharset_specified.htm
|
38
|
+
- tests/charset_utf8.htm
|
39
|
+
- tests/embeddoc1.htm
|
33
40
|
- tests/empty.htm
|
34
41
|
- tests/emptytitledoc.htm
|
35
42
|
- tests/fielddoc1.htm
|
36
43
|
- tests/fielddoc2.htm
|
37
44
|
- tests/fielddoc3.htm
|
38
45
|
- tests/flickerdoc1.htm
|
46
|
+
- tests/formdoc1.htm
|
47
|
+
- tests/formdoc2.htm
|
48
|
+
- tests/formdoc3.htm
|
39
49
|
- tests/framedoc1.htm
|
40
50
|
- tests/framedoc2.htm
|
51
|
+
- tests/full_berg.htm
|
41
52
|
- tests/full_google.htm
|
42
53
|
- tests/headingsdoc1.htm
|
43
54
|
- tests/headingsdoc2.htm
|
@@ -52,11 +63,13 @@ files:
|
|
52
63
|
- tests/imagedoc2.htm
|
53
64
|
- tests/imagedoc3.htm
|
54
65
|
- tests/imagedoc4.htm
|
66
|
+
- tests/inputimgdoc1.htm
|
55
67
|
- tests/invalidelements1.htm
|
56
68
|
- tests/invalidhtmldoc1.htm
|
57
69
|
- tests/invalidhtmldoc2.htm
|
58
70
|
- tests/invalidxhtmldoc1.htm
|
59
71
|
- tests/langinfodoc1.htm
|
72
|
+
- tests/langinfodoc2.htm
|
60
73
|
- tests/linkdoc1.htm
|
61
74
|
- tests/linkdoc2.htm
|
62
75
|
- tests/linkdoc3.htm
|
@@ -65,6 +78,7 @@ files:
|
|
65
78
|
- tests/metarefreshdoc2.htm
|
66
79
|
- tests/metarefreshdoc3.htm
|
67
80
|
- tests/nestedcomment.htm
|
81
|
+
- tests/nestedtabledoc.htm
|
68
82
|
- tests/newlinetext.txt
|
69
83
|
- tests/raakt_test.rb
|
70
84
|
- tests/scriptdoc1.htm
|
@@ -92,11 +106,11 @@ requirements: []
|
|
92
106
|
|
93
107
|
dependencies:
|
94
108
|
- !ruby/object:Gem::Dependency
|
95
|
-
name:
|
109
|
+
name: hpricot
|
96
110
|
version_requirement:
|
97
111
|
version_requirements: !ruby/object:Gem::Version::Requirement
|
98
112
|
requirements:
|
99
113
|
- - ">="
|
100
114
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
115
|
+
version: "0.5"
|
102
116
|
version:
|