feedtools 0.2.22 → 0.2.23

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.22'
10
+ PKG_VERSION = '0.2.23'
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
13
13
  RELEASE_NAME = "REL #{PKG_VERSION}"
@@ -139,244 +139,17 @@ Rake::GemPackageTask.new(spec) do |p|
139
139
  p.need_zip = true
140
140
  end
141
141
 
142
- task :benchmark do
142
+ task :profile do
143
143
  $:.unshift(File.dirname(__FILE__) + '/lib')
144
- require 'benchmark'
145
144
  require 'feed_tools'
146
- puts "Benchmarking FeedTools #{FEED_TOOLS_VERSION}..."
147
- results = Benchmark.measure do
148
- 10.times do
149
- feed = FeedTools::Feed.new
150
- once = Benchmark.measure do
151
- feed.feed_data = <<-FEED
152
- <?xml version="1.0" encoding="UTF-8"?>
153
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
154
- <channel rdf:about="http://slashdot.org/">
155
- <title>Slashdot</title>
156
- <link>http://slashdot.org/</link>
157
- <description>News for nerds, stuff that matters</description>
158
- <dc:language>en-us</dc:language>
159
- <dc:rights>Copyright 1997-2005, OSTG - Open Source Technology Group, Inc. All Rights Reserved.</dc:rights>
160
-
161
- <dc:date>2006-01-19T04:30:55+00:00</dc:date>
162
- <dc:publisher>OSTG</dc:publisher>
163
- <dc:creator>pater@slashdot.org</dc:creator>
164
- <dc:subject>Technology</dc:subject>
165
- <syn:updatePeriod>hourly</syn:updatePeriod>
166
- <syn:updateFrequency>1</syn:updateFrequency>
167
-
168
- <syn:updateBase>1970-01-01T00:00+00:00</syn:updateBase>
169
- <items>
170
- <rdf:Seq>
171
- <rdf:li rdf:resource="http://hardware.slashdot.org/article.pl?sid=06/01/19/0035238&amp;from=rss" />
172
- <rdf:li rdf:resource="http://developers.slashdot.org/article.pl?sid=06/01/19/0026203&amp;from=rss" />
173
- <rdf:li rdf:resource="http://science.slashdot.org/article.pl?sid=06/01/19/0019225&amp;from=rss" />
174
- <rdf:li rdf:resource="http://ask.slashdot.org/article.pl?sid=06/01/18/2133251&amp;from=rss" />
175
- <rdf:li rdf:resource="http://yro.slashdot.org/article.pl?sid=06/01/18/2037259&amp;from=rss" />
176
-
177
- <rdf:li rdf:resource="http://linux.slashdot.org/article.pl?sid=06/01/18/1945206&amp;from=rss" />
178
- <rdf:li rdf:resource="http://slashdot.org/article.pl?sid=06/01/18/1931219&amp;from=rss" />
179
- <rdf:li rdf:resource="http://science.slashdot.org/article.pl?sid=06/01/18/1832232&amp;from=rss" />
180
- <rdf:li rdf:resource="http://politics.slashdot.org/article.pl?sid=06/01/18/1722256&amp;from=rss" />
181
- <rdf:li rdf:resource="http://slashdot.org/article.pl?sid=06/01/18/1654232&amp;from=rss" />
182
- </rdf:Seq>
183
- </items>
184
- <image rdf:resource="http://images.slashdot.org/topics/topicslashdot.gif" />
185
- <textinput rdf:resource="http://slashdot.org/search.pl" />
186
-
187
- </channel>
188
- <image rdf:about="http://images.slashdot.org/topics/topicslashdot.gif">
189
- <title>Slashdot</title>
190
- <url>http://images.slashdot.org/topics/topicslashdot.gif</url>
191
- <link>http://slashdot.org/</link>
192
- </image>
193
- <item rdf:about="http://hardware.slashdot.org/article.pl?sid=06/01/19/0035238&amp;from=rss">
194
-
195
- <title>South Korea To Develop Army and Police Robots</title>
196
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3171</link>
197
- <description>JonathanGCohen writes "South Korea is planning on developing an advanced line of robots for military and police use by the 2010 decade. A $34 million USD infusion of cash will spur development and result in robotic applications like security watchmen and eight-legged autonomous combat vehicles. "&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3171"/&gt;</description>
198
- <dc:creator>samzenpus</dc:creator>
199
- <dc:date>2006-01-19T04:14:00+00:00</dc:date>
200
- <dc:subject>robotics</dc:subject>
201
-
202
- <slash:department>you-have-twenty-seconds-to-comply</slash:department>
203
- <slash:section>hardware</slash:section>
204
- <slash:comments>29</slash:comments>
205
- <slash:hit_parade>29,29,27,12,1,0,0</slash:hit_parade>
206
- <feedburner:origLink>http://hardware.slashdot.org/article.pl?sid=06/01/19/0035238&amp;from=rss</feedburner:origLink>
207
- </item>
208
-
209
- <item rdf:about="http://developers.slashdot.org/article.pl?sid=06/01/19/0026203&amp;from=rss">
210
- <title>Computer Science Students Outsource Homework</title>
211
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3170</link>
212
- <description>Carl Bialik from the WSJ writes "'If U.S. companies can go online to outsource their programming, why can't U.S. computer students outsource their homework--which, after all, often involves writing sample programs?' Wall Street Journal colummnist Lee Gomes asks. 'Scruples aside, no reason at all. Search for "homework" in the data base of Rent A Coder projects, and you get 1,000 hits. (An impressive number, but still a tiny fraction of all computer students, the vast majority of whom are no doubt an honest and hardworking lot.)' Some of the Rent a Coder users appear to be outsourcing their way through school, at low costs--probably less than $100 per assignment. The posting are, of course, anonymous, but Gomes traces one to a student at the New Jersey Institute of Technology, where an instructor tells him that Rent a Coder contributed to a problem of plagiarism last semester."&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3170"/&gt;</description>
213
- <dc:creator>samzenpus</dc:creator>
214
- <dc:date>2006-01-19T03:08:00+00:00</dc:date>
215
-
216
- <dc:subject>ed</dc:subject>
217
- <slash:department>what-happened-to-putting-it-into-your-graphing-calculator</slash:department>
218
- <slash:section>developers</slash:section>
219
- <slash:comments>142</slash:comments>
220
- <slash:hit_parade>142,139,121,75,18,8,4</slash:hit_parade>
221
- <feedburner:origLink>http://developers.slashdot.org/article.pl?sid=06/01/19/0026203&amp;from=rss</feedburner:origLink>
222
-
223
- </item>
224
- <item rdf:about="http://science.slashdot.org/article.pl?sid=06/01/19/0019225&amp;from=rss">
225
- <title>MythBusters - The Lost Experiments</title>
226
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3169</link>
227
- <description>theLorax writes "From Discovery: "If you like the MythBusters here are some videos they just posted of some of the out takes and things that didn't appear on the show. Cola bits (cleaning things with cola), water torture, otter ping pong, live power lines, cement build up and plywood flight." Here is the interview we did with these guys in December.
228
- &lt;p&gt;&lt;a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=SXBhr7"&gt;&lt;img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=SXBhr7" border="0"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3169"/&gt;</description>
229
-
230
- <dc:creator>samzenpus</dc:creator>
231
- <dc:date>2006-01-19T01:58:00+00:00</dc:date>
232
- <dc:subject>tv</dc:subject>
233
- <slash:department>they-should-battle-mr.wizard</slash:department>
234
- <slash:section>science</slash:section>
235
- <slash:comments>134</slash:comments>
236
-
237
- <slash:hit_parade>134,130,95,61,23,12,6</slash:hit_parade>
238
- <feedburner:origLink>http://science.slashdot.org/article.pl?sid=06/01/19/0019225&amp;from=rss</feedburner:origLink>
239
- </item>
240
- <item rdf:about="http://ask.slashdot.org/article.pl?sid=06/01/18/2133251&amp;from=rss">
241
- <title>Has Corporate Info Security Gotten Out of Hand?</title>
242
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3168</link>
243
-
244
- <description>KoshClassic asks: "What is the right balance between security and productivity, in the corporate IT environment? Looking back at my company, 10 years ago, our machines were connected directly to the Internet, no proxy, no firewall, no antivirus software. Today, my company's proxy server blocks access to: 'bad' web sites (such as Google Groups; our 'antivirus' software prevents our machines (even machines that host production applications) from carrying out legitimate functions, such as the sending of email via SMTP; and individual employees are forced to apply security patches with little or no notice, under threat of their machines loosing network access, if they do not comply by the deadline. On one hand, you can never be too secure, however on the other hand, have we become so secure that we're stifling our own ability to get things done? What is the situation like at other companies?"&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3168"/&gt;</description>
245
- <dc:creator>Cliff</dc:creator>
246
- <dc:date>2006-01-19T00:52:00+00:00</dc:date>
247
- <dc:subject>security</dc:subject>
248
- <slash:department>proper-security-is-like-walking-on-monowire</slash:department>
249
- <slash:section>askslashdot</slash:section>
250
-
251
- <slash:comments>259</slash:comments>
252
- <slash:hit_parade>259,253,200,130,29,16,11</slash:hit_parade>
253
- <feedburner:origLink>http://ask.slashdot.org/article.pl?sid=06/01/18/2133251&amp;from=rss</feedburner:origLink>
254
- </item>
255
- <item rdf:about="http://yro.slashdot.org/article.pl?sid=06/01/18/2037259&amp;from=rss">
256
- <title>Slashback: GPLv3, Firefly, iTunes</title>
257
-
258
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3167</link>
259
- <description>Slashback tonight brings some corrections, clarifications, and updates to previous Slashdot stories, including Stallman's comments on GPLv3, Firefly fans clinging to hope, sentence handed down in student felony webpage refresh case, GP2X GPL issues resolved, Korean cloning scientist may get to keep his patents, Apple changes their tune for iTunes ministore, and much more -- Read on for details.&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3167"/&gt;</description>
260
- <dc:creator>ScuttleMonkey</dc:creator>
261
- <dc:date>2006-01-18T23:59:00+00:00</dc:date>
262
- <dc:subject>slashback</dc:subject>
263
- <slash:department>different-results-from-the-same-actions</slash:department>
264
-
265
- <slash:section>yro</slash:section>
266
- <slash:comments>164</slash:comments>
267
- <slash:hit_parade>164,158,133,89,30,16,7</slash:hit_parade>
268
- <feedburner:origLink>http://yro.slashdot.org/article.pl?sid=06/01/18/2037259&amp;from=rss</feedburner:origLink>
269
- </item>
270
- <item rdf:about="http://linux.slashdot.org/article.pl?sid=06/01/18/1945206&amp;from=rss">
271
-
272
- <title>The Debian System Explained</title>
273
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3166</link>
274
- <description>An anonymous reader writes "XYZComputing has a great interview with Martin F. Krafft, the author of "The Debian System". From the article: 'Despite Debian GNU/Linux's important role in today's computing environment, it is largely misunderstood and oftentimes even discounted as being an operating system which is exclusively for professionals and elite users. In this book Krafft, explains his concept of Debian, which includes not only the operating system but also its underpinnings. Debian is not only a robust and scalable Linux distribution, but it has many other features which are worth looking into, like its open development cycle and rigorous quality control.'"
275
- &lt;p&gt;&lt;a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=GkVD75"&gt;&lt;img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=GkVD75" border="0"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3166"/&gt;</description>
276
- <dc:creator>ScuttleMonkey</dc:creator>
277
-
278
- <dc:date>2006-01-18T22:47:00+00:00</dc:date>
279
- <dc:subject>debian</dc:subject>
280
- <slash:department>solid-oak-log-for-the-distro-debate-fire</slash:department>
281
- <slash:section>linux</slash:section>
282
- <slash:comments>170</slash:comments>
283
- <slash:hit_parade>170,168,126,75,23,15,7</slash:hit_parade>
284
-
285
- <feedburner:origLink>http://linux.slashdot.org/article.pl?sid=06/01/18/1945206&amp;from=rss</feedburner:origLink>
286
- </item>
287
- <item rdf:about="http://slashdot.org/article.pl?sid=06/01/18/1931219&amp;from=rss">
288
- <title>Futuremark 3DMark06 Released</title>
289
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3165</link>
290
- <description>jmke writes "Futuremark has released their latest graphics card evaluation software. The 2006 version features all the latest technologies and will stress even the most expensive video cards. From the announcement: 'Continuing forward in the development of advanced game performance benchmarks, Futuremark announced today the release and immediate availability of 3DMark06. A more comprehensive and unrestricted benchmark than previous versions, 3DMark06 includes an array of 3D graphics, CPU and 3D feature tests for overall performance measurement of current and future PC gaming systems.' Futuremark is offering a free download of the software with limited capability while offering an advanced edition for a price. PC Perspectives also has a nice overview of some of the features available."&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3165"/&gt;</description>
291
-
292
- <dc:creator>ScuttleMonkey</dc:creator>
293
- <dc:date>2006-01-18T22:04:00+00:00</dc:date>
294
- <dc:subject>graphics</dc:subject>
295
- <slash:department>one-chip-to-rule-them-all</slash:department>
296
- <slash:section>mainpage</slash:section>
297
- <slash:comments>96</slash:comments>
298
-
299
- <slash:hit_parade>96,92,75,48,16,8,6</slash:hit_parade>
300
- <feedburner:origLink>http://slashdot.org/article.pl?sid=06/01/18/1931219&amp;from=rss</feedburner:origLink>
301
- </item>
302
- <item rdf:about="http://science.slashdot.org/article.pl?sid=06/01/18/1832232&amp;from=rss">
303
- <title>New Device to Detect Skin Cancer From A Picture?</title>
304
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3164</link>
305
-
306
- <description>JonathanGCohen writes "News.com is reporting on a new machine that can tell you all about your skin's unique features (excessive oil, UV damage, etc.) using an image scan and software to analyze it. Its inventors plan on developing a version that can even detect skin cancer." From the article: "Apart from numbers, the technology, called Clarity Pro, can depict the depth and severity of wrinkles in a 3D chart, show the extent of bacteria-filled pores in a graph, or represent UV damage in purple dots scattered about your face in a white-light image. It can also calculate how long a person can be exposed to the sun, in minutes or hours a day, before incurring more UV damage."&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3164"/&gt;</description>
307
- <dc:creator>ScuttleMonkey</dc:creator>
308
- <dc:date>2006-01-18T21:19:00+00:00</dc:date>
309
- <dc:subject>biotech</dc:subject>
310
- <slash:department>snapshot-physicals</slash:department>
311
- <slash:section>science</slash:section>
312
-
313
- <slash:comments>68</slash:comments>
314
- <slash:hit_parade>68,64,55,41,13,8,6</slash:hit_parade>
315
- <feedburner:origLink>http://science.slashdot.org/article.pl?sid=06/01/18/1832232&amp;from=rss</feedburner:origLink>
316
- </item>
317
- <item rdf:about="http://politics.slashdot.org/article.pl?sid=06/01/18/1722256&amp;from=rss">
318
- <title>Piracy Setup Discovered in WV Capitol Building</title>
319
-
320
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3163</link>
321
- <description>arakis writes "Someone in West Virginia has apparently spent tens of thousands in state funds to acquire computers and video gear to copy movies and music. From the article: 'Ferguson confirmed Tuesday that his staff found the makeshift audio-video studio amid his widening probe into spending and other abuses at the state General Services Division.' Looks like some employees are getting the axe for everything from purchasing abuse to time fraud."
322
- &lt;p&gt;&lt;a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=lS9OeC"&gt;&lt;img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=lS9OeC" border="0"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3163"/&gt;</description>
323
- <dc:creator>ScuttleMonkey</dc:creator>
324
- <dc:date>2006-01-18T20:36:00+00:00</dc:date>
325
-
326
- <dc:subject>media</dc:subject>
327
- <slash:department>making-a-little-on-the-side</slash:department>
328
- <slash:section>politics</slash:section>
329
- <slash:comments>311</slash:comments>
330
- <slash:hit_parade>311,304,232,144,47,26,20</slash:hit_parade>
331
- <feedburner:origLink>http://politics.slashdot.org/article.pl?sid=06/01/18/1722256&amp;from=rss</feedburner:origLink>
332
-
333
- </item>
334
- <item rdf:about="http://slashdot.org/article.pl?sid=06/01/18/1654232&amp;from=rss">
335
- <title>Admission Tickets as Text Messages</title>
336
- <link>http://rss.slashdot.org/Slashdot/slashdot?m=3162</link>
337
- <description>lee1 writes to tell us that InfoWorld is reporting that Smartmachine and their partner Skidata have developed a new way to allow customers to purchase and receive tickets to events. The new ticketing system allows users to "have a ticket sent to their mobile phone via SMS (Short Message Service) in the form of a 2D (two-dimensional) bar code. At the gate, they slide their mobile phone display showing the bar code by a bar code reader." The new technology also claims to help combat the counterfeit, pilferage, and repeat use that can be such a problem for paper tickets.&lt;img src="http://rss.slashdot.org/Slashdot/slashdot?g=3162"/&gt;</description>
338
- <dc:creator>ScuttleMonkey</dc:creator>
339
-
340
- <dc:date>2006-01-18T19:53:00+00:00</dc:date>
341
- <dc:subject>tech</dc:subject>
342
- <slash:department>hope-you-have-a-cell-phone</slash:department>
343
- <slash:section>mainpage</slash:section>
344
- <slash:comments>215</slash:comments>
345
- <slash:hit_parade>215,211,177,100,36,14,8</slash:hit_parade>
346
-
347
- <feedburner:origLink>http://slashdot.org/article.pl?sid=06/01/18/1654232&amp;from=rss</feedburner:origLink>
348
- </item>
349
- <textinput rdf:about="http://slashdot.org/search.pl">
350
- <title>Search Slashdot</title>
351
- <description>Search Slashdot stories</description>
352
- <name>query</name>
353
-
354
- <link>http://slashdot.org/search.pl</link>
355
- </textinput>
356
- </rdf:RDF>
357
- FEED
358
- feed.title
359
- feed.subtitle
360
- feed.link
361
- feed.url
362
- feed.time
363
- feed.entries.each do |entry|
364
- entry.title
365
- entry.link
366
- entry.content
367
- entry.tags
368
- entry.author
369
- entry.time
370
- end
371
- end
372
- puts "Parse: " + once.to_s
373
- once = Benchmark.measure do
374
- output_xml = feed.build_xml("atom", 1.0)
375
- end
376
- puts "Generate: " + once.to_s
377
- end
378
- end
379
- puts "Total: " + results.to_s
145
+ puts "Profiling FeedTools #{FEED_TOOLS_VERSION}..."
146
+ command = 'ruby -rprofile -e \'' +
147
+ '$:.unshift(File.dirname(__FILE__) + "/lib");' +
148
+ 'require "feed_tools";' +
149
+ 'FeedTools::Feed.open(' +
150
+ '"http://hsivonen.iki.fi/test/unknown-namespace.atom")' +
151
+ '.build_xml("atom", 1.0)\''
152
+ `#{command}`
380
153
  end
381
154
 
382
155
  task :lines do
@@ -28,7 +28,7 @@ class AmpTest < Test::Unit::TestCase
28
28
 
29
29
  def test_amp_03
30
30
  with_feed(:from_file => 'wellformed/amp/amp03.xml') { |feed|
31
- assert_equal("&", feed.entries.first.title)
31
+ assert_equal("&amp;", feed.entries.first.title)
32
32
  }
33
33
  end
34
34
 
@@ -52,7 +52,7 @@ class AmpTest < Test::Unit::TestCase
52
52
 
53
53
  def test_amp_07
54
54
  with_feed(:from_file => 'wellformed/amp/amp07.xml') { |feed|
55
- assert_equal("&", feed.entries.first.title)
55
+ assert_equal("&amp;", feed.entries.first.title)
56
56
  }
57
57
  end
58
58
 
@@ -76,7 +76,7 @@ class AmpTest < Test::Unit::TestCase
76
76
 
77
77
  def test_amp_11
78
78
  with_feed(:from_file => 'wellformed/amp/amp11.xml') { |feed|
79
- assert_equal("&", feed.entries.first.title)
79
+ assert_equal("&amp;", feed.entries.first.title)
80
80
  }
81
81
  end
82
82
 
@@ -316,7 +316,7 @@ class AmpTest < Test::Unit::TestCase
316
316
 
317
317
  def test_amp_51
318
318
  with_feed(:from_file => 'wellformed/amp/amp51.xml') { |feed|
319
- assert_equal("&", feed.entries.first.title)
319
+ assert_equal("&amp;", feed.entries.first.title)
320
320
  }
321
321
  end
322
322
 
@@ -364,37 +364,37 @@ class AmpTest < Test::Unit::TestCase
364
364
 
365
365
  def test_amp_59
366
366
  with_feed(:from_file => 'wellformed/amp/amp59.xml') { |feed|
367
- assert_equal("<div><b>&amp;</b></div>", feed.entries.first.title)
367
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
368
368
  }
369
369
  end
370
370
 
371
371
  def test_amp_60
372
372
  with_feed(:from_file => 'wellformed/amp/amp60.xml') { |feed|
373
- assert_equal("<div><b>&amp;</b></div>", feed.entries.first.title)
373
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
374
374
  }
375
375
  end
376
376
 
377
377
  def test_amp_61
378
378
  with_feed(:from_file => 'wellformed/amp/amp61.xml') { |feed|
379
- assert_equal("<div><b>&amp;</b></div>", feed.entries.first.title)
379
+ assert_equal("<b>&amp;</b>", feed.entries.first.title)
380
380
  }
381
381
  end
382
382
 
383
383
  def test_amp_62
384
384
  with_feed(:from_file => 'wellformed/amp/amp62.xml') { |feed|
385
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
385
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
386
386
  }
387
387
  end
388
388
 
389
389
  def test_amp_63
390
390
  with_feed(:from_file => 'wellformed/amp/amp63.xml') { |feed|
391
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
391
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
392
392
  }
393
393
  end
394
394
 
395
395
  def test_amp_64
396
396
  with_feed(:from_file => 'wellformed/amp/amp64.xml') { |feed|
397
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
397
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
398
398
  }
399
399
  end
400
400
 
@@ -410,16 +410,20 @@ class AmpTest < Test::Unit::TestCase
410
410
  </feed>
411
411
  FEED
412
412
  ) { |feed|
413
- assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.title)
414
- assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.tagline)
415
- assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.entries.first.title)
416
- assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.entries.first.content)
413
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
414
+ feed.title)
415
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
416
+ feed.tagline)
417
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
418
+ feed.entries.first.title)
419
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
420
+ feed.entries.first.content)
417
421
  }
418
422
  end
419
423
 
420
424
  def test_amp_tidy_01
421
425
  FeedTools.configurations[:tidy_enabled] = true
422
- assert_equal(true, FeedTools.tidy_enabled?,
426
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
423
427
  "Could not enable tidyhtml, library may be missing.")
424
428
  with_feed(:from_file => 'wellformed/amp/amp01.xml') { |feed|
425
429
  assert_equal("&amp;", feed.entries.first.title)
@@ -428,7 +432,7 @@ class AmpTest < Test::Unit::TestCase
428
432
 
429
433
  def test_amp_tidy_02
430
434
  FeedTools.configurations[:tidy_enabled] = true
431
- assert_equal(true, FeedTools.tidy_enabled?,
435
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
432
436
  "Could not enable tidyhtml, library may be missing.")
433
437
  with_feed(:from_file => 'wellformed/amp/amp02.xml') { |feed|
434
438
  assert_equal("&amp;", feed.entries.first.title)
@@ -437,16 +441,16 @@ class AmpTest < Test::Unit::TestCase
437
441
 
438
442
  def test_amp_tidy_03
439
443
  FeedTools.configurations[:tidy_enabled] = true
440
- assert_equal(true, FeedTools.tidy_enabled?,
444
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
441
445
  "Could not enable tidyhtml, library may be missing.")
442
446
  with_feed(:from_file => 'wellformed/amp/amp03.xml') { |feed|
443
- assert_equal("&", feed.entries.first.title)
447
+ assert_equal("&amp;", feed.entries.first.title)
444
448
  }
445
449
  end
446
450
 
447
451
  def test_amp_tidy_04
448
452
  FeedTools.configurations[:tidy_enabled] = true
449
- assert_equal(true, FeedTools.tidy_enabled?,
453
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
450
454
  "Could not enable tidyhtml, library may be missing.")
451
455
  with_feed(:from_file => 'wellformed/amp/amp04.xml') { |feed|
452
456
  assert_equal("&amp;", feed.entries.first.title)
@@ -455,7 +459,7 @@ class AmpTest < Test::Unit::TestCase
455
459
 
456
460
  def test_amp_tidy_05
457
461
  FeedTools.configurations[:tidy_enabled] = true
458
- assert_equal(true, FeedTools.tidy_enabled?,
462
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
459
463
  "Could not enable tidyhtml, library may be missing.")
460
464
  with_feed(:from_file => 'wellformed/amp/amp05.xml') { |feed|
461
465
  assert_equal("&amp;", feed.entries.first.title)
@@ -464,7 +468,7 @@ class AmpTest < Test::Unit::TestCase
464
468
 
465
469
  def test_amp_tidy_06
466
470
  FeedTools.configurations[:tidy_enabled] = true
467
- assert_equal(true, FeedTools.tidy_enabled?,
471
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
468
472
  "Could not enable tidyhtml, library may be missing.")
469
473
  with_feed(:from_file => 'wellformed/amp/amp06.xml') { |feed|
470
474
  assert_equal("&amp;", feed.entries.first.title)
@@ -473,16 +477,16 @@ class AmpTest < Test::Unit::TestCase
473
477
 
474
478
  def test_amp_tidy_07
475
479
  FeedTools.configurations[:tidy_enabled] = true
476
- assert_equal(true, FeedTools.tidy_enabled?,
480
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
477
481
  "Could not enable tidyhtml, library may be missing.")
478
482
  with_feed(:from_file => 'wellformed/amp/amp07.xml') { |feed|
479
- assert_equal("&", feed.entries.first.title)
483
+ assert_equal("&amp;", feed.entries.first.title)
480
484
  }
481
485
  end
482
486
 
483
487
  def test_amp_tidy_08
484
488
  FeedTools.configurations[:tidy_enabled] = true
485
- assert_equal(true, FeedTools.tidy_enabled?,
489
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
486
490
  "Could not enable tidyhtml, library may be missing.")
487
491
  with_feed(:from_file => 'wellformed/amp/amp08.xml') { |feed|
488
492
  assert_equal("&amp;", feed.entries.first.title)
@@ -491,7 +495,7 @@ class AmpTest < Test::Unit::TestCase
491
495
 
492
496
  def test_amp_tidy_09
493
497
  FeedTools.configurations[:tidy_enabled] = true
494
- assert_equal(true, FeedTools.tidy_enabled?,
498
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
495
499
  "Could not enable tidyhtml, library may be missing.")
496
500
  with_feed(:from_file => 'wellformed/amp/amp09.xml') { |feed|
497
501
  assert_equal("&amp;", feed.entries.first.title)
@@ -500,7 +504,7 @@ class AmpTest < Test::Unit::TestCase
500
504
 
501
505
  def test_amp_tidy_10
502
506
  FeedTools.configurations[:tidy_enabled] = true
503
- assert_equal(true, FeedTools.tidy_enabled?,
507
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
504
508
  "Could not enable tidyhtml, library may be missing.")
505
509
  with_feed(:from_file => 'wellformed/amp/amp10.xml') { |feed|
506
510
  assert_equal("&amp;", feed.entries.first.title)
@@ -509,16 +513,16 @@ class AmpTest < Test::Unit::TestCase
509
513
 
510
514
  def test_amp_tidy_11
511
515
  FeedTools.configurations[:tidy_enabled] = true
512
- assert_equal(true, FeedTools.tidy_enabled?,
516
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
513
517
  "Could not enable tidyhtml, library may be missing.")
514
518
  with_feed(:from_file => 'wellformed/amp/amp11.xml') { |feed|
515
- assert_equal("&", feed.entries.first.title)
519
+ assert_equal("&amp;", feed.entries.first.title)
516
520
  }
517
521
  end
518
522
 
519
523
  def test_amp_tidy_12
520
524
  FeedTools.configurations[:tidy_enabled] = true
521
- assert_equal(true, FeedTools.tidy_enabled?,
525
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
522
526
  "Could not enable tidyhtml, library may be missing.")
523
527
  with_feed(:from_file => 'wellformed/amp/amp12.xml') { |feed|
524
528
  assert_equal("&amp;", feed.entries.first.title)
@@ -527,7 +531,7 @@ class AmpTest < Test::Unit::TestCase
527
531
 
528
532
  def test_amp_tidy_13
529
533
  FeedTools.configurations[:tidy_enabled] = true
530
- assert_equal(true, FeedTools.tidy_enabled?,
534
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
531
535
  "Could not enable tidyhtml, library may be missing.")
532
536
  with_feed(:from_file => 'wellformed/amp/amp13.xml') { |feed|
533
537
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -536,7 +540,7 @@ class AmpTest < Test::Unit::TestCase
536
540
 
537
541
  def test_amp_tidy_14
538
542
  FeedTools.configurations[:tidy_enabled] = true
539
- assert_equal(true, FeedTools.tidy_enabled?,
543
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
540
544
  "Could not enable tidyhtml, library may be missing.")
541
545
  with_feed(:from_file => 'wellformed/amp/amp14.xml') { |feed|
542
546
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -545,7 +549,7 @@ class AmpTest < Test::Unit::TestCase
545
549
 
546
550
  def test_amp_tidy_15
547
551
  FeedTools.configurations[:tidy_enabled] = true
548
- assert_equal(true, FeedTools.tidy_enabled?,
552
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
549
553
  "Could not enable tidyhtml, library may be missing.")
550
554
  with_feed(:from_file => 'wellformed/amp/amp15.xml') { |feed|
551
555
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -554,7 +558,7 @@ class AmpTest < Test::Unit::TestCase
554
558
 
555
559
  def test_amp_tidy_16
556
560
  FeedTools.configurations[:tidy_enabled] = true
557
- assert_equal(true, FeedTools.tidy_enabled?,
561
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
558
562
  "Could not enable tidyhtml, library may be missing.")
559
563
  with_feed(:from_file => 'wellformed/amp/amp16.xml') { |feed|
560
564
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -563,7 +567,7 @@ class AmpTest < Test::Unit::TestCase
563
567
 
564
568
  def test_amp_tidy_17
565
569
  FeedTools.configurations[:tidy_enabled] = true
566
- assert_equal(true, FeedTools.tidy_enabled?,
570
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
567
571
  "Could not enable tidyhtml, library may be missing.")
568
572
  with_feed(:from_file => 'wellformed/amp/amp17.xml') { |feed|
569
573
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -572,7 +576,7 @@ class AmpTest < Test::Unit::TestCase
572
576
 
573
577
  def test_amp_tidy_18
574
578
  FeedTools.configurations[:tidy_enabled] = true
575
- assert_equal(true, FeedTools.tidy_enabled?,
579
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
576
580
  "Could not enable tidyhtml, library may be missing.")
577
581
  with_feed(:from_file => 'wellformed/amp/amp18.xml') { |feed|
578
582
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -581,7 +585,7 @@ class AmpTest < Test::Unit::TestCase
581
585
 
582
586
  def test_amp_tidy_19
583
587
  FeedTools.configurations[:tidy_enabled] = true
584
- assert_equal(true, FeedTools.tidy_enabled?,
588
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
585
589
  "Could not enable tidyhtml, library may be missing.")
586
590
  with_feed(:from_file => 'wellformed/amp/amp19.xml') { |feed|
587
591
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -590,7 +594,7 @@ class AmpTest < Test::Unit::TestCase
590
594
 
591
595
  def test_amp_tidy_20
592
596
  FeedTools.configurations[:tidy_enabled] = true
593
- assert_equal(true, FeedTools.tidy_enabled?,
597
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
594
598
  "Could not enable tidyhtml, library may be missing.")
595
599
  with_feed(:from_file => 'wellformed/amp/amp20.xml') { |feed|
596
600
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -599,7 +603,7 @@ class AmpTest < Test::Unit::TestCase
599
603
 
600
604
  def test_amp_tidy_21
601
605
  FeedTools.configurations[:tidy_enabled] = true
602
- assert_equal(true, FeedTools.tidy_enabled?,
606
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
603
607
  "Could not enable tidyhtml, library may be missing.")
604
608
  with_feed(:from_file => 'wellformed/amp/amp21.xml') { |feed|
605
609
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -608,7 +612,7 @@ class AmpTest < Test::Unit::TestCase
608
612
 
609
613
  def test_amp_tidy_22
610
614
  FeedTools.configurations[:tidy_enabled] = true
611
- assert_equal(true, FeedTools.tidy_enabled?,
615
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
612
616
  "Could not enable tidyhtml, library may be missing.")
613
617
  with_feed(:from_file => 'wellformed/amp/amp22.xml') { |feed|
614
618
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -617,7 +621,7 @@ class AmpTest < Test::Unit::TestCase
617
621
 
618
622
  def test_amp_tidy_23
619
623
  FeedTools.configurations[:tidy_enabled] = true
620
- assert_equal(true, FeedTools.tidy_enabled?,
624
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
621
625
  "Could not enable tidyhtml, library may be missing.")
622
626
  with_feed(:from_file => 'wellformed/amp/amp23.xml') { |feed|
623
627
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -626,7 +630,7 @@ class AmpTest < Test::Unit::TestCase
626
630
 
627
631
  def test_amp_tidy_24
628
632
  FeedTools.configurations[:tidy_enabled] = true
629
- assert_equal(true, FeedTools.tidy_enabled?,
633
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
630
634
  "Could not enable tidyhtml, library may be missing.")
631
635
  with_feed(:from_file => 'wellformed/amp/amp24.xml') { |feed|
632
636
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -635,7 +639,7 @@ class AmpTest < Test::Unit::TestCase
635
639
 
636
640
  def test_amp_tidy_25
637
641
  FeedTools.configurations[:tidy_enabled] = true
638
- assert_equal(true, FeedTools.tidy_enabled?,
642
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
639
643
  "Could not enable tidyhtml, library may be missing.")
640
644
  with_feed(:from_file => 'wellformed/amp/amp25.xml') { |feed|
641
645
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -644,7 +648,7 @@ class AmpTest < Test::Unit::TestCase
644
648
 
645
649
  def test_amp_tidy_26
646
650
  FeedTools.configurations[:tidy_enabled] = true
647
- assert_equal(true, FeedTools.tidy_enabled?,
651
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
648
652
  "Could not enable tidyhtml, library may be missing.")
649
653
  with_feed(:from_file => 'wellformed/amp/amp26.xml') { |feed|
650
654
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -653,7 +657,7 @@ class AmpTest < Test::Unit::TestCase
653
657
 
654
658
  def test_amp_tidy_27
655
659
  FeedTools.configurations[:tidy_enabled] = true
656
- assert_equal(true, FeedTools.tidy_enabled?,
660
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
657
661
  "Could not enable tidyhtml, library may be missing.")
658
662
  with_feed(:from_file => 'wellformed/amp/amp27.xml') { |feed|
659
663
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -662,7 +666,7 @@ class AmpTest < Test::Unit::TestCase
662
666
 
663
667
  def test_amp_tidy_28
664
668
  FeedTools.configurations[:tidy_enabled] = true
665
- assert_equal(true, FeedTools.tidy_enabled?,
669
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
666
670
  "Could not enable tidyhtml, library may be missing.")
667
671
  with_feed(:from_file => 'wellformed/amp/amp28.xml') { |feed|
668
672
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -671,7 +675,7 @@ class AmpTest < Test::Unit::TestCase
671
675
 
672
676
  def test_amp_tidy_29
673
677
  FeedTools.configurations[:tidy_enabled] = true
674
- assert_equal(true, FeedTools.tidy_enabled?,
678
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
675
679
  "Could not enable tidyhtml, library may be missing.")
676
680
  with_feed(:from_file => 'wellformed/amp/amp29.xml') { |feed|
677
681
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -680,7 +684,7 @@ class AmpTest < Test::Unit::TestCase
680
684
 
681
685
  def test_amp_tidy_30
682
686
  FeedTools.configurations[:tidy_enabled] = true
683
- assert_equal(true, FeedTools.tidy_enabled?,
687
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
684
688
  "Could not enable tidyhtml, library may be missing.")
685
689
  with_feed(:from_file => 'wellformed/amp/amp30.xml') { |feed|
686
690
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -689,7 +693,7 @@ class AmpTest < Test::Unit::TestCase
689
693
 
690
694
  def test_amp_tidy_31
691
695
  FeedTools.configurations[:tidy_enabled] = true
692
- assert_equal(true, FeedTools.tidy_enabled?,
696
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
693
697
  "Could not enable tidyhtml, library may be missing.")
694
698
  with_feed(:from_file => 'wellformed/amp/amp31.xml') { |feed|
695
699
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -698,7 +702,7 @@ class AmpTest < Test::Unit::TestCase
698
702
 
699
703
  def test_amp_tidy_32
700
704
  FeedTools.configurations[:tidy_enabled] = true
701
- assert_equal(true, FeedTools.tidy_enabled?,
705
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
702
706
  "Could not enable tidyhtml, library may be missing.")
703
707
  with_feed(:from_file => 'wellformed/amp/amp32.xml') { |feed|
704
708
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -707,7 +711,7 @@ class AmpTest < Test::Unit::TestCase
707
711
 
708
712
  def test_amp_tidy_33
709
713
  FeedTools.configurations[:tidy_enabled] = true
710
- assert_equal(true, FeedTools.tidy_enabled?,
714
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
711
715
  "Could not enable tidyhtml, library may be missing.")
712
716
  with_feed(:from_file => 'wellformed/amp/amp33.xml') { |feed|
713
717
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -716,7 +720,7 @@ class AmpTest < Test::Unit::TestCase
716
720
 
717
721
  def test_amp_tidy_34
718
722
  FeedTools.configurations[:tidy_enabled] = true
719
- assert_equal(true, FeedTools.tidy_enabled?,
723
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
720
724
  "Could not enable tidyhtml, library may be missing.")
721
725
  with_feed(:from_file => 'wellformed/amp/amp34.xml') { |feed|
722
726
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -725,7 +729,7 @@ class AmpTest < Test::Unit::TestCase
725
729
 
726
730
  def test_amp_tidy_35
727
731
  FeedTools.configurations[:tidy_enabled] = true
728
- assert_equal(true, FeedTools.tidy_enabled?,
732
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
729
733
  "Could not enable tidyhtml, library may be missing.")
730
734
  with_feed(:from_file => 'wellformed/amp/amp35.xml') { |feed|
731
735
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -734,7 +738,7 @@ class AmpTest < Test::Unit::TestCase
734
738
 
735
739
  def test_amp_tidy_36
736
740
  FeedTools.configurations[:tidy_enabled] = true
737
- assert_equal(true, FeedTools.tidy_enabled?,
741
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
738
742
  "Could not enable tidyhtml, library may be missing.")
739
743
  with_feed(:from_file => 'wellformed/amp/amp36.xml') { |feed|
740
744
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -743,7 +747,7 @@ class AmpTest < Test::Unit::TestCase
743
747
 
744
748
  def test_amp_tidy_37
745
749
  FeedTools.configurations[:tidy_enabled] = true
746
- assert_equal(true, FeedTools.tidy_enabled?,
750
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
747
751
  "Could not enable tidyhtml, library may be missing.")
748
752
  with_feed(:from_file => 'wellformed/amp/amp37.xml') { |feed|
749
753
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -752,7 +756,7 @@ class AmpTest < Test::Unit::TestCase
752
756
 
753
757
  def test_amp_tidy_38
754
758
  FeedTools.configurations[:tidy_enabled] = true
755
- assert_equal(true, FeedTools.tidy_enabled?,
759
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
756
760
  "Could not enable tidyhtml, library may be missing.")
757
761
  with_feed(:from_file => 'wellformed/amp/amp38.xml') { |feed|
758
762
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -761,7 +765,7 @@ class AmpTest < Test::Unit::TestCase
761
765
 
762
766
  def test_amp_tidy_39
763
767
  FeedTools.configurations[:tidy_enabled] = true
764
- assert_equal(true, FeedTools.tidy_enabled?,
768
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
765
769
  "Could not enable tidyhtml, library may be missing.")
766
770
  with_feed(:from_file => 'wellformed/amp/amp39.xml') { |feed|
767
771
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -770,7 +774,7 @@ class AmpTest < Test::Unit::TestCase
770
774
 
771
775
  def test_amp_tidy_40
772
776
  FeedTools.configurations[:tidy_enabled] = true
773
- assert_equal(true, FeedTools.tidy_enabled?,
777
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
774
778
  "Could not enable tidyhtml, library may be missing.")
775
779
  with_feed(:from_file => 'wellformed/amp/amp40.xml') { |feed|
776
780
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -779,7 +783,7 @@ class AmpTest < Test::Unit::TestCase
779
783
 
780
784
  def test_amp_tidy_41
781
785
  FeedTools.configurations[:tidy_enabled] = true
782
- assert_equal(true, FeedTools.tidy_enabled?,
786
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
783
787
  "Could not enable tidyhtml, library may be missing.")
784
788
  with_feed(:from_file => 'wellformed/amp/amp41.xml') { |feed|
785
789
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -788,7 +792,7 @@ class AmpTest < Test::Unit::TestCase
788
792
 
789
793
  def test_amp_tidy_42
790
794
  FeedTools.configurations[:tidy_enabled] = true
791
- assert_equal(true, FeedTools.tidy_enabled?,
795
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
792
796
  "Could not enable tidyhtml, library may be missing.")
793
797
  with_feed(:from_file => 'wellformed/amp/amp42.xml') { |feed|
794
798
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -797,7 +801,7 @@ class AmpTest < Test::Unit::TestCase
797
801
 
798
802
  def test_amp_tidy_43
799
803
  FeedTools.configurations[:tidy_enabled] = true
800
- assert_equal(true, FeedTools.tidy_enabled?,
804
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
801
805
  "Could not enable tidyhtml, library may be missing.")
802
806
  with_feed(:from_file => 'wellformed/amp/amp43.xml') { |feed|
803
807
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -806,7 +810,7 @@ class AmpTest < Test::Unit::TestCase
806
810
 
807
811
  def test_amp_tidy_44
808
812
  FeedTools.configurations[:tidy_enabled] = true
809
- assert_equal(true, FeedTools.tidy_enabled?,
813
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
810
814
  "Could not enable tidyhtml, library may be missing.")
811
815
  with_feed(:from_file => 'wellformed/amp/amp44.xml') { |feed|
812
816
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -815,7 +819,7 @@ class AmpTest < Test::Unit::TestCase
815
819
 
816
820
  def test_amp_tidy_45
817
821
  FeedTools.configurations[:tidy_enabled] = true
818
- assert_equal(true, FeedTools.tidy_enabled?,
822
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
819
823
  "Could not enable tidyhtml, library may be missing.")
820
824
  with_feed(:from_file => 'wellformed/amp/amp45.xml') { |feed|
821
825
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -824,7 +828,7 @@ class AmpTest < Test::Unit::TestCase
824
828
 
825
829
  def test_amp_tidy_46
826
830
  FeedTools.configurations[:tidy_enabled] = true
827
- assert_equal(true, FeedTools.tidy_enabled?,
831
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
828
832
  "Could not enable tidyhtml, library may be missing.")
829
833
  with_feed(:from_file => 'wellformed/amp/amp46.xml') { |feed|
830
834
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -833,7 +837,7 @@ class AmpTest < Test::Unit::TestCase
833
837
 
834
838
  def test_amp_tidy_47
835
839
  FeedTools.configurations[:tidy_enabled] = true
836
- assert_equal(true, FeedTools.tidy_enabled?,
840
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
837
841
  "Could not enable tidyhtml, library may be missing.")
838
842
  with_feed(:from_file => 'wellformed/amp/amp47.xml') { |feed|
839
843
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -842,7 +846,7 @@ class AmpTest < Test::Unit::TestCase
842
846
 
843
847
  def test_amp_tidy_48
844
848
  FeedTools.configurations[:tidy_enabled] = true
845
- assert_equal(true, FeedTools.tidy_enabled?,
849
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
846
850
  "Could not enable tidyhtml, library may be missing.")
847
851
  with_feed(:from_file => 'wellformed/amp/amp48.xml') { |feed|
848
852
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -851,7 +855,7 @@ class AmpTest < Test::Unit::TestCase
851
855
 
852
856
  def test_amp_tidy_49
853
857
  FeedTools.configurations[:tidy_enabled] = true
854
- assert_equal(true, FeedTools.tidy_enabled?,
858
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
855
859
  "Could not enable tidyhtml, library may be missing.")
856
860
  with_feed(:from_file => 'wellformed/amp/amp49.xml') { |feed|
857
861
  assert_equal("&amp;", feed.entries.first.title)
@@ -860,7 +864,7 @@ class AmpTest < Test::Unit::TestCase
860
864
 
861
865
  def test_amp_tidy_50
862
866
  FeedTools.configurations[:tidy_enabled] = true
863
- assert_equal(true, FeedTools.tidy_enabled?,
867
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
864
868
  "Could not enable tidyhtml, library may be missing.")
865
869
  with_feed(:from_file => 'wellformed/amp/amp50.xml') { |feed|
866
870
  assert_equal("&amp;", feed.entries.first.title)
@@ -869,16 +873,16 @@ class AmpTest < Test::Unit::TestCase
869
873
 
870
874
  def test_amp_tidy_51
871
875
  FeedTools.configurations[:tidy_enabled] = true
872
- assert_equal(true, FeedTools.tidy_enabled?,
876
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
873
877
  "Could not enable tidyhtml, library may be missing.")
874
878
  with_feed(:from_file => 'wellformed/amp/amp51.xml') { |feed|
875
- assert_equal("&", feed.entries.first.title)
879
+ assert_equal("&amp;", feed.entries.first.title)
876
880
  }
877
881
  end
878
882
 
879
883
  def test_amp_tidy_52
880
884
  FeedTools.configurations[:tidy_enabled] = true
881
- assert_equal(true, FeedTools.tidy_enabled?,
885
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
882
886
  "Could not enable tidyhtml, library may be missing.")
883
887
  with_feed(:from_file => 'wellformed/amp/amp52.xml') { |feed|
884
888
  assert_equal("&amp;", feed.entries.first.title)
@@ -887,7 +891,7 @@ class AmpTest < Test::Unit::TestCase
887
891
 
888
892
  def test_amp_tidy_53
889
893
  FeedTools.configurations[:tidy_enabled] = true
890
- assert_equal(true, FeedTools.tidy_enabled?,
894
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
891
895
  "Could not enable tidyhtml, library may be missing.")
892
896
  with_feed(:from_file => 'wellformed/amp/amp53.xml') { |feed|
893
897
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -896,7 +900,7 @@ class AmpTest < Test::Unit::TestCase
896
900
 
897
901
  def test_amp_tidy_54
898
902
  FeedTools.configurations[:tidy_enabled] = true
899
- assert_equal(true, FeedTools.tidy_enabled?,
903
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
900
904
  "Could not enable tidyhtml, library may be missing.")
901
905
  with_feed(:from_file => 'wellformed/amp/amp54.xml') { |feed|
902
906
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -905,7 +909,7 @@ class AmpTest < Test::Unit::TestCase
905
909
 
906
910
  def test_amp_tidy_55
907
911
  FeedTools.configurations[:tidy_enabled] = true
908
- assert_equal(true, FeedTools.tidy_enabled?,
912
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
909
913
  "Could not enable tidyhtml, library may be missing.")
910
914
  with_feed(:from_file => 'wellformed/amp/amp55.xml') { |feed|
911
915
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -914,7 +918,7 @@ class AmpTest < Test::Unit::TestCase
914
918
 
915
919
  def test_amp_tidy_56
916
920
  FeedTools.configurations[:tidy_enabled] = true
917
- assert_equal(true, FeedTools.tidy_enabled?,
921
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
918
922
  "Could not enable tidyhtml, library may be missing.")
919
923
  with_feed(:from_file => 'wellformed/amp/amp56.xml') { |feed|
920
924
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -923,7 +927,7 @@ class AmpTest < Test::Unit::TestCase
923
927
 
924
928
  def test_amp_tidy_57
925
929
  FeedTools.configurations[:tidy_enabled] = true
926
- assert_equal(true, FeedTools.tidy_enabled?,
930
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
927
931
  "Could not enable tidyhtml, library may be missing.")
928
932
  with_feed(:from_file => 'wellformed/amp/amp57.xml') { |feed|
929
933
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -932,7 +936,7 @@ class AmpTest < Test::Unit::TestCase
932
936
 
933
937
  def test_amp_tidy_58
934
938
  FeedTools.configurations[:tidy_enabled] = true
935
- assert_equal(true, FeedTools.tidy_enabled?,
939
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
936
940
  "Could not enable tidyhtml, library may be missing.")
937
941
  with_feed(:from_file => 'wellformed/amp/amp58.xml') { |feed|
938
942
  assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
@@ -941,61 +945,61 @@ class AmpTest < Test::Unit::TestCase
941
945
 
942
946
  def test_amp_tidy_59
943
947
  FeedTools.configurations[:tidy_enabled] = true
944
- assert_equal(true, FeedTools.tidy_enabled?,
948
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
945
949
  "Could not enable tidyhtml, library may be missing.")
946
950
  with_feed(:from_file => 'wellformed/amp/amp59.xml') { |feed|
947
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
951
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
948
952
  }
949
953
  end
950
954
 
951
955
  def test_amp_tidy_60
952
956
  FeedTools.configurations[:tidy_enabled] = true
953
- assert_equal(true, FeedTools.tidy_enabled?,
957
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
954
958
  "Could not enable tidyhtml, library may be missing.")
955
959
  with_feed(:from_file => 'wellformed/amp/amp60.xml') { |feed|
956
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
960
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
957
961
  }
958
962
  end
959
963
 
960
964
  def test_amp_tidy_61
961
965
  FeedTools.configurations[:tidy_enabled] = true
962
- assert_equal(true, FeedTools.tidy_enabled?,
966
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
963
967
  "Could not enable tidyhtml, library may be missing.")
964
968
  with_feed(:from_file => 'wellformed/amp/amp61.xml') { |feed|
965
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
969
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
966
970
  }
967
971
  end
968
972
 
969
973
  def test_amp_tidy_62
970
974
  FeedTools.configurations[:tidy_enabled] = true
971
- assert_equal(true, FeedTools.tidy_enabled?,
975
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
972
976
  "Could not enable tidyhtml, library may be missing.")
973
977
  with_feed(:from_file => 'wellformed/amp/amp62.xml') { |feed|
974
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
978
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
975
979
  }
976
980
  end
977
981
 
978
982
  def test_amp_tidy_63
979
983
  FeedTools.configurations[:tidy_enabled] = true
980
- assert_equal(true, FeedTools.tidy_enabled?,
984
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
981
985
  "Could not enable tidyhtml, library may be missing.")
982
986
  with_feed(:from_file => 'wellformed/amp/amp63.xml') { |feed|
983
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
987
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
984
988
  }
985
989
  end
986
990
 
987
991
  def test_amp_tidy_64
988
992
  FeedTools.configurations[:tidy_enabled] = true
989
- assert_equal(true, FeedTools.tidy_enabled?,
993
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
990
994
  "Could not enable tidyhtml, library may be missing.")
991
995
  with_feed(:from_file => 'wellformed/amp/amp64.xml') { |feed|
992
- assert_equal("<div><strong>&amp;</strong></div>", feed.entries.first.title)
996
+ assert_equal("<strong>&amp;</strong>", feed.entries.first.title)
993
997
  }
994
998
  end
995
999
 
996
1000
  def test_amp_tidy_65
997
1001
  FeedTools.configurations[:tidy_enabled] = true
998
- assert_equal(true, FeedTools.tidy_enabled?,
1002
+ assert_equal(true, FeedTools::HtmlHelper.tidy_enabled?,
999
1003
  "Could not enable tidyhtml, library may be missing.")
1000
1004
  with_feed(:from_data => <<-FEED
1001
1005
  <feed version="0.3">
@@ -1008,10 +1012,14 @@ class AmpTest < Test::Unit::TestCase
1008
1012
  </feed>
1009
1013
  FEED
1010
1014
  ) { |feed|
1011
- assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.title)
1012
- assert_equal("<strong>1 &amp; 2 &amp; 3</strong>", feed.tagline)
1013
- assert_equal("<strong>1 &amp; 2 & 3</strong>", feed.entries.first.title)
1014
- assert_equal("<strong>1 &amp; 2 &amp; 3</strong>", feed.entries.first.content)
1015
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
1016
+ feed.title)
1017
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
1018
+ feed.tagline)
1019
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
1020
+ feed.entries.first.title)
1021
+ assert_equal("&lt;strong&gt;1 &amp;amp; 2 &amp; 3&lt;/strong&gt;",
1022
+ feed.entries.first.content)
1015
1023
  }
1016
1024
  end
1017
- end
1025
+ end