feedtools 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/gempackagetask'
7
7
  require 'rake/contrib/rubyforgepublisher'
8
8
 
9
9
  PKG_NAME = 'feedtools'
10
- PKG_VERSION = '0.2.1'
10
+ PKG_VERSION = '0.2.2'
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
13
13
  RELEASE_NAME = "REL #{PKG_VERSION}"
data/test/amp_test.rb ADDED
@@ -0,0 +1,475 @@
1
+ require 'test/unit'
2
+ require 'feed_tools'
3
+
4
+ class AmpTest < Test::Unit::TestCase
5
+ def setup
6
+ FeedTools.tidy_enabled = false
7
+ end
8
+
9
+ def test_amp_01
10
+ feed = FeedTools::Feed.open(
11
+ 'http://feedparser.org/tests/wellformed/amp/amp01.xml')
12
+ assert_equal("&amp;", feed.entries.first.title)
13
+ assert_equal(false, feed.bozo?)
14
+ end
15
+
16
+ def test_amp_02
17
+ feed = FeedTools::Feed.open(
18
+ 'http://feedparser.org/tests/wellformed/amp/amp02.xml')
19
+ assert_equal("&amp;", feed.entries.first.title)
20
+ assert_equal(false, feed.bozo?)
21
+ end
22
+
23
+ def test_amp_03
24
+ feed = FeedTools::Feed.open(
25
+ 'http://feedparser.org/tests/wellformed/amp/amp03.xml')
26
+ assert_equal("&", feed.entries.first.title)
27
+ assert_equal(false, feed.bozo?)
28
+ end
29
+
30
+ def test_amp_04
31
+ feed = FeedTools::Feed.open(
32
+ 'http://feedparser.org/tests/wellformed/amp/amp04.xml')
33
+ assert_equal("&amp;", feed.entries.first.title)
34
+ assert_equal(false, feed.bozo?)
35
+ end
36
+
37
+ def test_amp_05
38
+ feed = FeedTools::Feed.open(
39
+ 'http://feedparser.org/tests/wellformed/amp/amp05.xml')
40
+ assert_equal("&amp;", feed.entries.first.title)
41
+ assert_equal(false, feed.bozo?)
42
+ end
43
+
44
+ def test_amp_06
45
+ feed = FeedTools::Feed.open(
46
+ 'http://feedparser.org/tests/wellformed/amp/amp06.xml')
47
+ assert_equal("&amp;", feed.entries.first.title)
48
+ assert_equal(false, feed.bozo?)
49
+ end
50
+
51
+ def test_amp_07
52
+ feed = FeedTools::Feed.open(
53
+ 'http://feedparser.org/tests/wellformed/amp/amp07.xml')
54
+ assert_equal("&", feed.entries.first.title)
55
+ assert_equal(false, feed.bozo?)
56
+ end
57
+
58
+ def test_amp_08
59
+ feed = FeedTools::Feed.open(
60
+ 'http://feedparser.org/tests/wellformed/amp/amp08.xml')
61
+ assert_equal("&amp;", feed.entries.first.title)
62
+ assert_equal(false, feed.bozo?)
63
+ end
64
+
65
+ def test_amp_09
66
+ feed = FeedTools::Feed.open(
67
+ 'http://feedparser.org/tests/wellformed/amp/amp09.xml')
68
+ assert_equal("&amp;", feed.entries.first.title)
69
+ assert_equal(false, feed.bozo?)
70
+ end
71
+
72
+ def test_amp_10
73
+ feed = FeedTools::Feed.open(
74
+ 'http://feedparser.org/tests/wellformed/amp/amp10.xml')
75
+ assert_equal("&amp;", feed.entries.first.title)
76
+ assert_equal(false, feed.bozo?)
77
+ end
78
+
79
+ def test_amp_11
80
+ feed = FeedTools::Feed.open(
81
+ 'http://feedparser.org/tests/wellformed/amp/amp11.xml')
82
+ assert_equal("&", feed.entries.first.title)
83
+ assert_equal(false, feed.bozo?)
84
+ end
85
+
86
+ def test_amp_12
87
+ feed = FeedTools::Feed.open(
88
+ 'http://feedparser.org/tests/wellformed/amp/amp12.xml')
89
+ assert_equal("&amp;", feed.entries.first.title)
90
+ assert_equal(false, feed.bozo?)
91
+ end
92
+
93
+ def test_amp_13
94
+ feed = FeedTools::Feed.open(
95
+ 'http://feedparser.org/tests/wellformed/amp/amp13.xml')
96
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
97
+ assert_equal(false, feed.bozo?)
98
+ end
99
+
100
+ def test_amp_14
101
+ feed = FeedTools::Feed.open(
102
+ 'http://feedparser.org/tests/wellformed/amp/amp14.xml')
103
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
104
+ assert_equal(false, feed.bozo?)
105
+ end
106
+
107
+ def test_amp_15
108
+ feed = FeedTools::Feed.open(
109
+ 'http://feedparser.org/tests/wellformed/amp/amp15.xml')
110
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
111
+ assert_equal(false, feed.bozo?)
112
+ end
113
+
114
+ def test_amp_16
115
+ feed = FeedTools::Feed.open(
116
+ 'http://feedparser.org/tests/wellformed/amp/amp16.xml')
117
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
118
+ assert_equal(false, feed.bozo?)
119
+ end
120
+
121
+ def test_amp_17
122
+ feed = FeedTools::Feed.open(
123
+ 'http://feedparser.org/tests/wellformed/amp/amp17.xml')
124
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
125
+ assert_equal(false, feed.bozo?)
126
+ end
127
+
128
+ def test_amp_18
129
+ feed = FeedTools::Feed.open(
130
+ 'http://feedparser.org/tests/wellformed/amp/amp18.xml')
131
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
132
+ assert_equal(false, feed.bozo?)
133
+ end
134
+
135
+ def test_amp_19
136
+ feed = FeedTools::Feed.open(
137
+ 'http://feedparser.org/tests/wellformed/amp/amp19.xml')
138
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
139
+ assert_equal(false, feed.bozo?)
140
+ end
141
+
142
+ def test_amp_20
143
+ feed = FeedTools::Feed.open(
144
+ 'http://feedparser.org/tests/wellformed/amp/amp20.xml')
145
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
146
+ assert_equal(false, feed.bozo?)
147
+ end
148
+
149
+ def test_amp_21
150
+ feed = FeedTools::Feed.open(
151
+ 'http://feedparser.org/tests/wellformed/amp/amp21.xml')
152
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
153
+ assert_equal(false, feed.bozo?)
154
+ end
155
+
156
+ def test_amp_22
157
+ feed = FeedTools::Feed.open(
158
+ 'http://feedparser.org/tests/wellformed/amp/amp22.xml')
159
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
160
+ assert_equal(false, feed.bozo?)
161
+ end
162
+
163
+ def test_amp_23
164
+ feed = FeedTools::Feed.open(
165
+ 'http://feedparser.org/tests/wellformed/amp/amp23.xml')
166
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
167
+ assert_equal(false, feed.bozo?)
168
+ end
169
+
170
+ def test_amp_24
171
+ feed = FeedTools::Feed.open(
172
+ 'http://feedparser.org/tests/wellformed/amp/amp24.xml')
173
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
174
+ assert_equal(false, feed.bozo?)
175
+ end
176
+
177
+ def test_amp_25
178
+ feed = FeedTools::Feed.open(
179
+ 'http://feedparser.org/tests/wellformed/amp/amp25.xml')
180
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
181
+ assert_equal(false, feed.bozo?)
182
+ end
183
+
184
+ def test_amp_26
185
+ feed = FeedTools::Feed.open(
186
+ 'http://feedparser.org/tests/wellformed/amp/amp26.xml')
187
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
188
+ assert_equal(false, feed.bozo?)
189
+ end
190
+
191
+ def test_amp_27
192
+ feed = FeedTools::Feed.open(
193
+ 'http://feedparser.org/tests/wellformed/amp/amp27.xml')
194
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
195
+ assert_equal(false, feed.bozo?)
196
+ end
197
+
198
+ def test_amp_28
199
+ feed = FeedTools::Feed.open(
200
+ 'http://feedparser.org/tests/wellformed/amp/amp28.xml')
201
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
202
+ assert_equal(false, feed.bozo?)
203
+ end
204
+
205
+ def test_amp_29
206
+ feed = FeedTools::Feed.open(
207
+ 'http://feedparser.org/tests/wellformed/amp/amp29.xml')
208
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
209
+ assert_equal(false, feed.bozo?)
210
+ end
211
+
212
+ def test_amp_30
213
+ feed = FeedTools::Feed.open(
214
+ 'http://feedparser.org/tests/wellformed/amp/amp30.xml')
215
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
216
+ assert_equal(false, feed.bozo?)
217
+ end
218
+
219
+ def test_amp_31
220
+ feed = FeedTools::Feed.open(
221
+ 'http://feedparser.org/tests/wellformed/amp/amp31.xml')
222
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
223
+ assert_equal(false, feed.bozo?)
224
+ end
225
+
226
+ def test_amp_32
227
+ feed = FeedTools::Feed.open(
228
+ 'http://feedparser.org/tests/wellformed/amp/amp32.xml')
229
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
230
+ assert_equal(false, feed.bozo?)
231
+ end
232
+
233
+ def test_amp_33
234
+ feed = FeedTools::Feed.open(
235
+ 'http://feedparser.org/tests/wellformed/amp/amp33.xml')
236
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
237
+ assert_equal(false, feed.bozo?)
238
+ end
239
+
240
+ def test_amp_34
241
+ feed = FeedTools::Feed.open(
242
+ 'http://feedparser.org/tests/wellformed/amp/amp34.xml')
243
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
244
+ assert_equal(false, feed.bozo?)
245
+ end
246
+
247
+ def test_amp_35
248
+ feed = FeedTools::Feed.open(
249
+ 'http://feedparser.org/tests/wellformed/amp/amp35.xml')
250
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
251
+ assert_equal(false, feed.bozo?)
252
+ end
253
+
254
+ def test_amp_36
255
+ feed = FeedTools::Feed.open(
256
+ 'http://feedparser.org/tests/wellformed/amp/amp36.xml')
257
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
258
+ assert_equal(false, feed.bozo?)
259
+ end
260
+
261
+ def test_amp_37
262
+ feed = FeedTools::Feed.open(
263
+ 'http://feedparser.org/tests/wellformed/amp/amp37.xml')
264
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
265
+ assert_equal(false, feed.bozo?)
266
+ end
267
+
268
+ def test_amp_38
269
+ feed = FeedTools::Feed.open(
270
+ 'http://feedparser.org/tests/wellformed/amp/amp38.xml')
271
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
272
+ assert_equal(false, feed.bozo?)
273
+ end
274
+
275
+ def test_amp_39
276
+ feed = FeedTools::Feed.open(
277
+ 'http://feedparser.org/tests/wellformed/amp/amp39.xml')
278
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
279
+ assert_equal(false, feed.bozo?)
280
+ end
281
+
282
+ def test_amp_40
283
+ feed = FeedTools::Feed.open(
284
+ 'http://feedparser.org/tests/wellformed/amp/amp40.xml')
285
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
286
+ assert_equal(false, feed.bozo?)
287
+ end
288
+
289
+ def test_amp_41
290
+ feed = FeedTools::Feed.open(
291
+ 'http://feedparser.org/tests/wellformed/amp/amp41.xml')
292
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
293
+ assert_equal(false, feed.bozo?)
294
+ end
295
+
296
+ def test_amp_42
297
+ feed = FeedTools::Feed.open(
298
+ 'http://feedparser.org/tests/wellformed/amp/amp42.xml')
299
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
300
+ assert_equal(false, feed.bozo?)
301
+ end
302
+
303
+ def test_amp_43
304
+ feed = FeedTools::Feed.open(
305
+ 'http://feedparser.org/tests/wellformed/amp/amp43.xml')
306
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
307
+ assert_equal(false, feed.bozo?)
308
+ end
309
+
310
+ def test_amp_44
311
+ feed = FeedTools::Feed.open(
312
+ 'http://feedparser.org/tests/wellformed/amp/amp44.xml')
313
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
314
+ assert_equal(false, feed.bozo?)
315
+ end
316
+
317
+ def test_amp_45
318
+ feed = FeedTools::Feed.open(
319
+ 'http://feedparser.org/tests/wellformed/amp/amp45.xml')
320
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
321
+ assert_equal(false, feed.bozo?)
322
+ end
323
+
324
+ def test_amp_46
325
+ feed = FeedTools::Feed.open(
326
+ 'http://feedparser.org/tests/wellformed/amp/amp46.xml')
327
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
328
+ assert_equal(false, feed.bozo?)
329
+ end
330
+
331
+ def test_amp_47
332
+ feed = FeedTools::Feed.open(
333
+ 'http://feedparser.org/tests/wellformed/amp/amp47.xml')
334
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
335
+ assert_equal(false, feed.bozo?)
336
+ end
337
+
338
+ def test_amp_48
339
+ feed = FeedTools::Feed.open(
340
+ 'http://feedparser.org/tests/wellformed/amp/amp48.xml')
341
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
342
+ assert_equal(false, feed.bozo?)
343
+ end
344
+
345
+ def test_amp_49
346
+ feed = FeedTools::Feed.open(
347
+ 'http://feedparser.org/tests/wellformed/amp/amp49.xml')
348
+ assert_equal("&amp;", feed.entries.first.title)
349
+ assert_equal(false, feed.bozo?)
350
+ end
351
+
352
+ def test_amp_50
353
+ feed = FeedTools::Feed.open(
354
+ 'http://feedparser.org/tests/wellformed/amp/amp50.xml')
355
+ assert_equal("&amp;", feed.entries.first.title)
356
+ assert_equal(false, feed.bozo?)
357
+ end
358
+
359
+ def test_amp_51
360
+ feed = FeedTools::Feed.open(
361
+ 'http://feedparser.org/tests/wellformed/amp/amp51.xml')
362
+ assert_equal("&", feed.entries.first.title)
363
+ assert_equal(false, feed.bozo?)
364
+ end
365
+
366
+ def test_amp_52
367
+ feed = FeedTools::Feed.open(
368
+ 'http://feedparser.org/tests/wellformed/amp/amp52.xml')
369
+ assert_equal("&amp;", feed.entries.first.title)
370
+ assert_equal(false, feed.bozo?)
371
+ end
372
+
373
+ def test_amp_53
374
+ feed = FeedTools::Feed.open(
375
+ 'http://feedparser.org/tests/wellformed/amp/amp53.xml')
376
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
377
+ assert_equal(false, feed.bozo?)
378
+ end
379
+
380
+ def test_amp_54
381
+ feed = FeedTools::Feed.open(
382
+ 'http://feedparser.org/tests/wellformed/amp/amp54.xml')
383
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
384
+ assert_equal(false, feed.bozo?)
385
+ end
386
+
387
+ def test_amp_55
388
+ feed = FeedTools::Feed.open(
389
+ 'http://feedparser.org/tests/wellformed/amp/amp55.xml')
390
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
391
+ assert_equal(false, feed.bozo?)
392
+ end
393
+
394
+ def test_amp_56
395
+ feed = FeedTools::Feed.open(
396
+ 'http://feedparser.org/tests/wellformed/amp/amp56.xml')
397
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
398
+ assert_equal(false, feed.bozo?)
399
+ end
400
+
401
+ def test_amp_57
402
+ feed = FeedTools::Feed.open(
403
+ 'http://feedparser.org/tests/wellformed/amp/amp57.xml')
404
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
405
+ assert_equal(false, feed.bozo?)
406
+ end
407
+
408
+ def test_amp_58
409
+ feed = FeedTools::Feed.open(
410
+ 'http://feedparser.org/tests/wellformed/amp/amp58.xml')
411
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
412
+ assert_equal(false, feed.bozo?)
413
+ end
414
+
415
+ def test_amp_59
416
+ feed = FeedTools::Feed.open(
417
+ 'http://feedparser.org/tests/wellformed/amp/amp59.xml')
418
+ assert_equal("<div><b>&amp;</b></div>", feed.entries.first.title)
419
+ assert_equal(false, feed.bozo?)
420
+ end
421
+
422
+ def test_amp_60
423
+ feed = FeedTools::Feed.open(
424
+ 'http://feedparser.org/tests/wellformed/amp/amp60.xml')
425
+ assert_equal("<div><b>&amp;</b></div>", feed.entries.first.title)
426
+ assert_equal(false, feed.bozo?)
427
+ end
428
+
429
+ def test_amp_61
430
+ feed = FeedTools::Feed.open(
431
+ 'http://feedparser.org/tests/wellformed/amp/amp61.xml')
432
+ assert_equal("<div><b>&amp;</b></div>", feed.entries.first.title)
433
+ assert_equal(false, feed.bozo?)
434
+ end
435
+
436
+ def test_amp_62
437
+ feed = FeedTools::Feed.open(
438
+ 'http://feedparser.org/tests/wellformed/amp/amp62.xml')
439
+ assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
440
+ assert_equal(false, feed.bozo?)
441
+ end
442
+
443
+ def test_amp_63
444
+ feed = FeedTools::Feed.open(
445
+ 'http://feedparser.org/tests/wellformed/amp/amp63.xml')
446
+ assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
447
+ assert_equal(false, feed.bozo?)
448
+ end
449
+
450
+ def test_amp_64
451
+ feed = FeedTools::Feed.open(
452
+ 'http://feedparser.org/tests/wellformed/amp/amp64.xml')
453
+ assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
454
+ assert_equal(false, feed.bozo?)
455
+ end
456
+
457
+ def test_amp_65
458
+ feed = FeedTools::Feed.new
459
+ feed.xml_data = <<-FEED
460
+ <feed version="0.3">
461
+ <title>&lt;strong>1 &amp;amp; 2 &amp; 3&lt;/strong></title>
462
+ <tagline>&lt;strong>1 &amp;amp; 2 &amp; 3&lt;/strong></tagline>
463
+ <entry>
464
+ <title>&lt;strong>1 &amp;amp; 2 &amp; 3&lt;/strong></title>
465
+ <content>&lt;strong>1 &amp;amp; 2 &amp; 3&lt;/strong></content>
466
+ </entry>
467
+ </feed>
468
+ FEED
469
+ assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.title)
470
+ assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.tagline)
471
+ assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.entries.first.title)
472
+ assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.entries.first.content)
473
+ assert_equal(false, feed.bozo?)
474
+ end
475
+ end