feedtools 0.2.17 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +8 -0
- data/lib/feed_tools.rb +34 -12
- data/lib/feed_tools/database_feed_cache.rb +24 -0
- data/lib/feed_tools/feed.rb +238 -82
- data/lib/feed_tools/feed_item.rb +218 -106
- data/lib/feed_tools/helpers/feed_helper.rb +27 -0
- data/lib/feed_tools/helpers/feed_item_helper.rb +27 -0
- data/lib/feed_tools/helpers/feed_tools_helper.rb +78 -0
- data/lib/feed_tools/helpers/generic_helper.rb +36 -0
- data/lib/feed_tools/helpers/module_helper.rb +27 -0
- data/rakefile +2 -2
- data/test/unit/amp_test.rb +406 -398
- data/test/unit/atom_test.rb +41 -16
- data/test/unit/cdf_test.rb +55 -49
- data/test/unit/generation_test.rb +1 -1
- data/test/unit/helper_test.rb +4 -0
- data/test/unit/nonstandard_test.rb +58 -50
- data/test/unit/rss_test.rb +510 -530
- metadata +8 -2
@@ -0,0 +1,27 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module FeedTools
|
25
|
+
module FeedHelper
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module FeedTools
|
25
|
+
module FeedItemHelper
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#
|
23
|
+
# Contributors: Jens Kraemer
|
24
|
+
#++
|
25
|
+
|
26
|
+
require 'feed_tools'
|
27
|
+
require 'feed_tools/helpers/generic_helper'
|
28
|
+
|
29
|
+
# This module provides helper methods for simplifying normal interactions with
|
30
|
+
# the FeedTools library.
|
31
|
+
module FeedToolsHelper
|
32
|
+
include FeedTools::GenericHelper
|
33
|
+
private :validate_options
|
34
|
+
|
35
|
+
@@default_local_path = File.expand_path('.')
|
36
|
+
|
37
|
+
# Returns the default path to load local files from
|
38
|
+
def self.default_local_path
|
39
|
+
@@default_local_path
|
40
|
+
end
|
41
|
+
|
42
|
+
# Sets the default path to load local files from
|
43
|
+
def self.default_local_path=(new_default_local_path)
|
44
|
+
@@default_local_path = new_default_local_path
|
45
|
+
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
# Loads a feed within a block for more consistent syntax and control
|
49
|
+
# over the FeedTools environment.
|
50
|
+
def with_feed(options={})
|
51
|
+
validate_options([ :from_file, :from_url, :from_data, :feed_cache ],
|
52
|
+
options.keys)
|
53
|
+
options = { :feed_cache => FeedTools.feed_cache }.merge(options)
|
54
|
+
if options[:from_file]
|
55
|
+
file_path = File.expand_path(@@default_local_path + '/' +
|
56
|
+
options[:from_file])
|
57
|
+
if !File.exists?(file_path)
|
58
|
+
file_path = File.expand_path(options[:from_file])
|
59
|
+
end
|
60
|
+
if !File.exists?(file_path)
|
61
|
+
raise "No such file - #{file_path}"
|
62
|
+
end
|
63
|
+
feed = FeedTools::Feed.open("file://#{file_path}")
|
64
|
+
elsif options[:from_url]
|
65
|
+
feed = FeedTools::Feed.open(options[:from_url])
|
66
|
+
elsif options[:from_data]
|
67
|
+
feed = FeedTools::Feed.new
|
68
|
+
feed.feed_data = options[:from_data]
|
69
|
+
else
|
70
|
+
raise "No data source specified"
|
71
|
+
end
|
72
|
+
@@save_cache = FeedTools.feed_cache
|
73
|
+
FeedTools.feed_cache = options[:feed_cache]
|
74
|
+
yield feed
|
75
|
+
FeedTools.feed_cache = @@save_cache
|
76
|
+
feed = nil
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module FeedTools
|
25
|
+
# Generic methods needed in numerous places throughout FeedTools
|
26
|
+
module GenericHelper
|
27
|
+
# Raises an exception if an invalid option has been specified to prevent
|
28
|
+
# misspellings from slipping through
|
29
|
+
def validate_options(valid_option_keys, supplied_option_keys)
|
30
|
+
unknown_option_keys = supplied_option_keys - valid_option_keys
|
31
|
+
unless unknown_option_keys.empty?
|
32
|
+
raise "Unknown options: #{unknown_option_keys}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module FeedTools
|
25
|
+
module FeedToolsModuleHelper
|
26
|
+
end
|
27
|
+
end
|
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.
|
10
|
+
PKG_VERSION = '0.2.18'
|
11
11
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
12
|
|
13
13
|
RELEASE_NAME = "REL #{PKG_VERSION}"
|
@@ -18,7 +18,7 @@ RUBY_FORGE_USER = "vacindak"
|
|
18
18
|
PKG_FILES = FileList[
|
19
19
|
"lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "db/**/*",
|
20
20
|
"[A-Z]*", "install.rb", "rakefile"
|
21
|
-
].exclude(/\bCVS\b|~$/).exclude(/database\.yml/)
|
21
|
+
].exclude(/\bCVS\b|~$/).exclude(/database\.yml/).exclude(/\._.*/)
|
22
22
|
|
23
23
|
desc "Default Task"
|
24
24
|
task :default => [ :test_all ]
|
data/test/unit/amp_test.rb
CHANGED
@@ -1,399 +1,404 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'feed_tools'
|
3
|
+
require 'feed_tools/helpers/feed_tools_helper'
|
3
4
|
|
4
5
|
class AmpTest < Test::Unit::TestCase
|
6
|
+
include FeedToolsHelper
|
7
|
+
|
5
8
|
def setup
|
6
9
|
FeedTools.tidy_enabled = false
|
7
10
|
FeedTools.feed_cache = FeedTools::DatabaseFeedCache
|
11
|
+
FeedToolsHelper.default_local_path =
|
12
|
+
File.expand_path(
|
13
|
+
File.expand_path(File.dirname(__FILE__)) + '/../feeds')
|
8
14
|
end
|
9
15
|
|
10
16
|
def test_amp_01
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
with_feed(:from_file => 'wellformed/amp/amp01.xml') { |feed|
|
18
|
+
assert_equal("&", feed.entries.first.title)
|
19
|
+
}
|
14
20
|
end
|
15
21
|
|
16
22
|
def test_amp_02
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
with_feed(:from_file => 'wellformed/amp/amp02.xml') { |feed|
|
24
|
+
assert_equal("&", feed.entries.first.title)
|
25
|
+
}
|
20
26
|
end
|
21
27
|
|
22
28
|
def test_amp_03
|
23
|
-
|
24
|
-
|
25
|
-
|
29
|
+
with_feed(:from_file => 'wellformed/amp/amp03.xml') { |feed|
|
30
|
+
assert_equal("&", feed.entries.first.title)
|
31
|
+
}
|
26
32
|
end
|
27
33
|
|
28
34
|
def test_amp_04
|
29
|
-
|
30
|
-
|
31
|
-
|
35
|
+
with_feed(:from_file => 'wellformed/amp/amp04.xml') { |feed|
|
36
|
+
assert_equal("&", feed.entries.first.title)
|
37
|
+
}
|
32
38
|
end
|
33
39
|
|
34
40
|
def test_amp_05
|
35
|
-
|
36
|
-
|
37
|
-
|
41
|
+
with_feed(:from_file => 'wellformed/amp/amp05.xml') { |feed|
|
42
|
+
assert_equal("&", feed.entries.first.title)
|
43
|
+
}
|
38
44
|
end
|
39
45
|
|
40
46
|
def test_amp_06
|
41
|
-
|
42
|
-
|
43
|
-
|
47
|
+
with_feed(:from_file => 'wellformed/amp/amp06.xml') { |feed|
|
48
|
+
assert_equal("&", feed.entries.first.title)
|
49
|
+
}
|
44
50
|
end
|
45
51
|
|
46
52
|
def test_amp_07
|
47
|
-
|
48
|
-
|
49
|
-
|
53
|
+
with_feed(:from_file => 'wellformed/amp/amp07.xml') { |feed|
|
54
|
+
assert_equal("&", feed.entries.first.title)
|
55
|
+
}
|
50
56
|
end
|
51
57
|
|
52
58
|
def test_amp_08
|
53
|
-
|
54
|
-
|
55
|
-
|
59
|
+
with_feed(:from_file => 'wellformed/amp/amp08.xml') { |feed|
|
60
|
+
assert_equal("&", feed.entries.first.title)
|
61
|
+
}
|
56
62
|
end
|
57
63
|
|
58
64
|
def test_amp_09
|
59
|
-
|
60
|
-
|
61
|
-
|
65
|
+
with_feed(:from_file => 'wellformed/amp/amp09.xml') { |feed|
|
66
|
+
assert_equal("&", feed.entries.first.title)
|
67
|
+
}
|
62
68
|
end
|
63
69
|
|
64
70
|
def test_amp_10
|
65
|
-
|
66
|
-
|
67
|
-
|
71
|
+
with_feed(:from_file => 'wellformed/amp/amp10.xml') { |feed|
|
72
|
+
assert_equal("&", feed.entries.first.title)
|
73
|
+
}
|
68
74
|
end
|
69
75
|
|
70
76
|
def test_amp_11
|
71
|
-
|
72
|
-
|
73
|
-
|
77
|
+
with_feed(:from_file => 'wellformed/amp/amp11.xml') { |feed|
|
78
|
+
assert_equal("&", feed.entries.first.title)
|
79
|
+
}
|
74
80
|
end
|
75
81
|
|
76
82
|
def test_amp_12
|
77
|
-
|
78
|
-
|
79
|
-
|
83
|
+
with_feed(:from_file => 'wellformed/amp/amp12.xml') { |feed|
|
84
|
+
assert_equal("&", feed.entries.first.title)
|
85
|
+
}
|
80
86
|
end
|
81
87
|
|
82
88
|
def test_amp_13
|
83
|
-
|
84
|
-
|
85
|
-
|
89
|
+
with_feed(:from_file => 'wellformed/amp/amp13.xml') { |feed|
|
90
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
91
|
+
}
|
86
92
|
end
|
87
93
|
|
88
94
|
def test_amp_14
|
89
|
-
|
90
|
-
|
91
|
-
|
95
|
+
with_feed(:from_file => 'wellformed/amp/amp14.xml') { |feed|
|
96
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
97
|
+
}
|
92
98
|
end
|
93
99
|
|
94
100
|
def test_amp_15
|
95
|
-
|
96
|
-
|
97
|
-
|
101
|
+
with_feed(:from_file => 'wellformed/amp/amp15.xml') { |feed|
|
102
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
103
|
+
}
|
98
104
|
end
|
99
105
|
|
100
106
|
def test_amp_16
|
101
|
-
|
102
|
-
|
103
|
-
|
107
|
+
with_feed(:from_file => 'wellformed/amp/amp16.xml') { |feed|
|
108
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
109
|
+
}
|
104
110
|
end
|
105
111
|
|
106
112
|
def test_amp_17
|
107
|
-
|
108
|
-
|
109
|
-
|
113
|
+
with_feed(:from_file => 'wellformed/amp/amp17.xml') { |feed|
|
114
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
115
|
+
}
|
110
116
|
end
|
111
117
|
|
112
118
|
def test_amp_18
|
113
|
-
|
114
|
-
|
115
|
-
|
119
|
+
with_feed(:from_file => 'wellformed/amp/amp18.xml') { |feed|
|
120
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
121
|
+
}
|
116
122
|
end
|
117
123
|
|
118
124
|
def test_amp_19
|
119
|
-
|
120
|
-
|
121
|
-
|
125
|
+
with_feed(:from_file => 'wellformed/amp/amp19.xml') { |feed|
|
126
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
127
|
+
}
|
122
128
|
end
|
123
129
|
|
124
130
|
def test_amp_20
|
125
|
-
|
126
|
-
|
127
|
-
|
131
|
+
with_feed(:from_file => 'wellformed/amp/amp20.xml') { |feed|
|
132
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
133
|
+
}
|
128
134
|
end
|
129
135
|
|
130
136
|
def test_amp_21
|
131
|
-
|
132
|
-
|
133
|
-
|
137
|
+
with_feed(:from_file => 'wellformed/amp/amp21.xml') { |feed|
|
138
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
139
|
+
}
|
134
140
|
end
|
135
141
|
|
136
142
|
def test_amp_22
|
137
|
-
|
138
|
-
|
139
|
-
|
143
|
+
with_feed(:from_file => 'wellformed/amp/amp22.xml') { |feed|
|
144
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
145
|
+
}
|
140
146
|
end
|
141
147
|
|
142
148
|
def test_amp_23
|
143
|
-
|
144
|
-
|
145
|
-
|
149
|
+
with_feed(:from_file => 'wellformed/amp/amp23.xml') { |feed|
|
150
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
151
|
+
}
|
146
152
|
end
|
147
153
|
|
148
154
|
def test_amp_24
|
149
|
-
|
150
|
-
|
151
|
-
|
155
|
+
with_feed(:from_file => 'wellformed/amp/amp24.xml') { |feed|
|
156
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
157
|
+
}
|
152
158
|
end
|
153
159
|
|
154
160
|
def test_amp_25
|
155
|
-
|
156
|
-
|
157
|
-
|
161
|
+
with_feed(:from_file => 'wellformed/amp/amp25.xml') { |feed|
|
162
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
163
|
+
}
|
158
164
|
end
|
159
165
|
|
160
166
|
def test_amp_26
|
161
|
-
|
162
|
-
|
163
|
-
|
167
|
+
with_feed(:from_file => 'wellformed/amp/amp26.xml') { |feed|
|
168
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
169
|
+
}
|
164
170
|
end
|
165
171
|
|
166
172
|
def test_amp_27
|
167
|
-
|
168
|
-
|
169
|
-
|
173
|
+
with_feed(:from_file => 'wellformed/amp/amp27.xml') { |feed|
|
174
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
175
|
+
}
|
170
176
|
end
|
171
177
|
|
172
178
|
def test_amp_28
|
173
|
-
|
174
|
-
|
175
|
-
|
179
|
+
with_feed(:from_file => 'wellformed/amp/amp28.xml') { |feed|
|
180
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
181
|
+
}
|
176
182
|
end
|
177
183
|
|
178
184
|
def test_amp_29
|
179
|
-
|
180
|
-
|
181
|
-
|
185
|
+
with_feed(:from_file => 'wellformed/amp/amp29.xml') { |feed|
|
186
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
187
|
+
}
|
182
188
|
end
|
183
189
|
|
184
190
|
def test_amp_30
|
185
|
-
|
186
|
-
|
187
|
-
|
191
|
+
with_feed(:from_file => 'wellformed/amp/amp30.xml') { |feed|
|
192
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
193
|
+
}
|
188
194
|
end
|
189
195
|
|
190
196
|
def test_amp_31
|
191
|
-
|
192
|
-
|
193
|
-
|
197
|
+
with_feed(:from_file => 'wellformed/amp/amp31.xml') { |feed|
|
198
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
199
|
+
}
|
194
200
|
end
|
195
201
|
|
196
202
|
def test_amp_32
|
197
|
-
|
198
|
-
|
199
|
-
|
203
|
+
with_feed(:from_file => 'wellformed/amp/amp32.xml') { |feed|
|
204
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
205
|
+
}
|
200
206
|
end
|
201
207
|
|
202
208
|
def test_amp_33
|
203
|
-
|
204
|
-
|
205
|
-
|
209
|
+
with_feed(:from_file => 'wellformed/amp/amp33.xml') { |feed|
|
210
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
211
|
+
}
|
206
212
|
end
|
207
213
|
|
208
214
|
def test_amp_34
|
209
|
-
|
210
|
-
|
211
|
-
|
215
|
+
with_feed(:from_file => 'wellformed/amp/amp34.xml') { |feed|
|
216
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
217
|
+
}
|
212
218
|
end
|
213
219
|
|
214
220
|
def test_amp_35
|
215
|
-
|
216
|
-
|
217
|
-
|
221
|
+
with_feed(:from_file => 'wellformed/amp/amp35.xml') { |feed|
|
222
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
223
|
+
}
|
218
224
|
end
|
219
225
|
|
220
226
|
def test_amp_36
|
221
|
-
|
222
|
-
|
223
|
-
|
227
|
+
with_feed(:from_file => 'wellformed/amp/amp36.xml') { |feed|
|
228
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
229
|
+
}
|
224
230
|
end
|
225
231
|
|
226
232
|
def test_amp_37
|
227
|
-
|
228
|
-
|
229
|
-
|
233
|
+
with_feed(:from_file => 'wellformed/amp/amp37.xml') { |feed|
|
234
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
235
|
+
}
|
230
236
|
end
|
231
237
|
|
232
238
|
def test_amp_38
|
233
|
-
|
234
|
-
|
235
|
-
|
239
|
+
with_feed(:from_file => 'wellformed/amp/amp38.xml') { |feed|
|
240
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
241
|
+
}
|
236
242
|
end
|
237
243
|
|
238
244
|
def test_amp_39
|
239
|
-
|
240
|
-
|
241
|
-
|
245
|
+
with_feed(:from_file => 'wellformed/amp/amp39.xml') { |feed|
|
246
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
247
|
+
}
|
242
248
|
end
|
243
249
|
|
244
250
|
def test_amp_40
|
245
|
-
|
246
|
-
|
247
|
-
|
251
|
+
with_feed(:from_file => 'wellformed/amp/amp40.xml') { |feed|
|
252
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
253
|
+
}
|
248
254
|
end
|
249
255
|
|
250
256
|
def test_amp_41
|
251
|
-
|
252
|
-
|
253
|
-
|
257
|
+
with_feed(:from_file => 'wellformed/amp/amp41.xml') { |feed|
|
258
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
259
|
+
}
|
254
260
|
end
|
255
261
|
|
256
262
|
def test_amp_42
|
257
|
-
|
258
|
-
|
259
|
-
|
263
|
+
with_feed(:from_file => 'wellformed/amp/amp42.xml') { |feed|
|
264
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
265
|
+
}
|
260
266
|
end
|
261
267
|
|
262
268
|
def test_amp_43
|
263
|
-
|
264
|
-
|
265
|
-
|
269
|
+
with_feed(:from_file => 'wellformed/amp/amp43.xml') { |feed|
|
270
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
271
|
+
}
|
266
272
|
end
|
267
273
|
|
268
274
|
def test_amp_44
|
269
|
-
|
270
|
-
|
271
|
-
|
275
|
+
with_feed(:from_file => 'wellformed/amp/amp44.xml') { |feed|
|
276
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
277
|
+
}
|
272
278
|
end
|
273
279
|
|
274
280
|
def test_amp_45
|
275
|
-
|
276
|
-
|
277
|
-
|
281
|
+
with_feed(:from_file => 'wellformed/amp/amp45.xml') { |feed|
|
282
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
283
|
+
}
|
278
284
|
end
|
279
285
|
|
280
286
|
def test_amp_46
|
281
|
-
|
282
|
-
|
283
|
-
|
287
|
+
with_feed(:from_file => 'wellformed/amp/amp46.xml') { |feed|
|
288
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
289
|
+
}
|
284
290
|
end
|
285
291
|
|
286
292
|
def test_amp_47
|
287
|
-
|
288
|
-
|
289
|
-
|
293
|
+
with_feed(:from_file => 'wellformed/amp/amp47.xml') { |feed|
|
294
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
295
|
+
}
|
290
296
|
end
|
291
297
|
|
292
298
|
def test_amp_48
|
293
|
-
|
294
|
-
|
295
|
-
|
299
|
+
with_feed(:from_file => 'wellformed/amp/amp48.xml') { |feed|
|
300
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
301
|
+
}
|
296
302
|
end
|
297
303
|
|
298
304
|
def test_amp_49
|
299
|
-
|
300
|
-
|
301
|
-
|
305
|
+
with_feed(:from_file => 'wellformed/amp/amp49.xml') { |feed|
|
306
|
+
assert_equal("&", feed.entries.first.title)
|
307
|
+
}
|
302
308
|
end
|
303
309
|
|
304
310
|
def test_amp_50
|
305
|
-
|
306
|
-
|
307
|
-
|
311
|
+
with_feed(:from_file => 'wellformed/amp/amp50.xml') { |feed|
|
312
|
+
assert_equal("&", feed.entries.first.title)
|
313
|
+
}
|
308
314
|
end
|
309
315
|
|
310
316
|
def test_amp_51
|
311
|
-
|
312
|
-
|
313
|
-
|
317
|
+
with_feed(:from_file => 'wellformed/amp/amp51.xml') { |feed|
|
318
|
+
assert_equal("&", feed.entries.first.title)
|
319
|
+
}
|
314
320
|
end
|
315
321
|
|
316
322
|
def test_amp_52
|
317
|
-
|
318
|
-
|
319
|
-
|
323
|
+
with_feed(:from_file => 'wellformed/amp/amp52.xml') { |feed|
|
324
|
+
assert_equal("&", feed.entries.first.title)
|
325
|
+
}
|
320
326
|
end
|
321
327
|
|
322
328
|
def test_amp_53
|
323
|
-
|
324
|
-
|
325
|
-
|
329
|
+
with_feed(:from_file => 'wellformed/amp/amp53.xml') { |feed|
|
330
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
331
|
+
}
|
326
332
|
end
|
327
333
|
|
328
334
|
def test_amp_54
|
329
|
-
|
330
|
-
|
331
|
-
|
335
|
+
with_feed(:from_file => 'wellformed/amp/amp54.xml') { |feed|
|
336
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
337
|
+
}
|
332
338
|
end
|
333
339
|
|
334
340
|
def test_amp_55
|
335
|
-
|
336
|
-
|
337
|
-
|
341
|
+
with_feed(:from_file => 'wellformed/amp/amp55.xml') { |feed|
|
342
|
+
assert_equal("<b>&</b>", feed.entries.first.title)
|
343
|
+
}
|
338
344
|
end
|
339
345
|
|
340
346
|
def test_amp_56
|
341
|
-
|
342
|
-
|
343
|
-
|
347
|
+
with_feed(:from_file => 'wellformed/amp/amp56.xml') { |feed|
|
348
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
349
|
+
}
|
344
350
|
end
|
345
351
|
|
346
352
|
def test_amp_57
|
347
|
-
|
348
|
-
|
349
|
-
|
353
|
+
with_feed(:from_file => 'wellformed/amp/amp57.xml') { |feed|
|
354
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
355
|
+
}
|
350
356
|
end
|
351
357
|
|
352
358
|
def test_amp_58
|
353
|
-
|
354
|
-
|
355
|
-
|
359
|
+
with_feed(:from_file => 'wellformed/amp/amp58.xml') { |feed|
|
360
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
361
|
+
}
|
356
362
|
end
|
357
363
|
|
358
364
|
def test_amp_59
|
359
|
-
|
360
|
-
|
361
|
-
|
365
|
+
with_feed(:from_file => 'wellformed/amp/amp59.xml') { |feed|
|
366
|
+
assert_equal("<div><b>&</b></div>", feed.entries.first.title)
|
367
|
+
}
|
362
368
|
end
|
363
369
|
|
364
370
|
def test_amp_60
|
365
|
-
|
366
|
-
|
367
|
-
|
371
|
+
with_feed(:from_file => 'wellformed/amp/amp60.xml') { |feed|
|
372
|
+
assert_equal("<div><b>&</b></div>", feed.entries.first.title)
|
373
|
+
}
|
368
374
|
end
|
369
375
|
|
370
376
|
def test_amp_61
|
371
|
-
|
372
|
-
|
373
|
-
|
377
|
+
with_feed(:from_file => 'wellformed/amp/amp61.xml') { |feed|
|
378
|
+
assert_equal("<div><b>&</b></div>", feed.entries.first.title)
|
379
|
+
}
|
374
380
|
end
|
375
381
|
|
376
382
|
def test_amp_62
|
377
|
-
|
378
|
-
|
379
|
-
|
383
|
+
with_feed(:from_file => 'wellformed/amp/amp62.xml') { |feed|
|
384
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
385
|
+
}
|
380
386
|
end
|
381
387
|
|
382
388
|
def test_amp_63
|
383
|
-
|
384
|
-
|
385
|
-
|
389
|
+
with_feed(:from_file => 'wellformed/amp/amp63.xml') { |feed|
|
390
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
391
|
+
}
|
386
392
|
end
|
387
393
|
|
388
394
|
def test_amp_64
|
389
|
-
|
390
|
-
|
391
|
-
|
395
|
+
with_feed(:from_file => 'wellformed/amp/amp64.xml') { |feed|
|
396
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
397
|
+
}
|
392
398
|
end
|
393
399
|
|
394
400
|
def test_amp_65
|
395
|
-
|
396
|
-
feed.feed_data = <<-FEED
|
401
|
+
with_feed(:from_data => <<-FEED
|
397
402
|
<feed version="0.3">
|
398
403
|
<title><strong>1 &amp; 2 & 3</strong></title>
|
399
404
|
<tagline><strong>1 &amp; 2 & 3</strong></tagline>
|
@@ -403,594 +408,595 @@ class AmpTest < Test::Unit::TestCase
|
|
403
408
|
</entry>
|
404
409
|
</feed>
|
405
410
|
FEED
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
411
|
+
) { |feed|
|
412
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.title)
|
413
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.tagline)
|
414
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.entries.first.title)
|
415
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.entries.first.content)
|
416
|
+
}
|
410
417
|
end
|
411
418
|
|
412
419
|
def test_amp_tidy_01
|
413
420
|
FeedTools.tidy_enabled = true
|
414
421
|
assert_equal(true, FeedTools.tidy_enabled?,
|
415
422
|
"Could not enable tidyhtml, library may be missing.")
|
416
|
-
|
417
|
-
|
418
|
-
|
423
|
+
with_feed(:from_file => 'wellformed/amp/amp01.xml') { |feed|
|
424
|
+
assert_equal("&", feed.entries.first.title)
|
425
|
+
}
|
419
426
|
end
|
420
427
|
|
421
428
|
def test_amp_tidy_02
|
422
429
|
FeedTools.tidy_enabled = true
|
423
430
|
assert_equal(true, FeedTools.tidy_enabled?,
|
424
431
|
"Could not enable tidyhtml, library may be missing.")
|
425
|
-
|
426
|
-
|
427
|
-
|
432
|
+
with_feed(:from_file => 'wellformed/amp/amp02.xml') { |feed|
|
433
|
+
assert_equal("&", feed.entries.first.title)
|
434
|
+
}
|
428
435
|
end
|
429
436
|
|
430
437
|
def test_amp_tidy_03
|
431
438
|
FeedTools.tidy_enabled = true
|
432
439
|
assert_equal(true, FeedTools.tidy_enabled?,
|
433
440
|
"Could not enable tidyhtml, library may be missing.")
|
434
|
-
|
435
|
-
|
436
|
-
|
441
|
+
with_feed(:from_file => 'wellformed/amp/amp03.xml') { |feed|
|
442
|
+
assert_equal("&", feed.entries.first.title)
|
443
|
+
}
|
437
444
|
end
|
438
445
|
|
439
446
|
def test_amp_tidy_04
|
440
447
|
FeedTools.tidy_enabled = true
|
441
448
|
assert_equal(true, FeedTools.tidy_enabled?,
|
442
449
|
"Could not enable tidyhtml, library may be missing.")
|
443
|
-
|
444
|
-
|
445
|
-
|
450
|
+
with_feed(:from_file => 'wellformed/amp/amp04.xml') { |feed|
|
451
|
+
assert_equal("&", feed.entries.first.title)
|
452
|
+
}
|
446
453
|
end
|
447
454
|
|
448
455
|
def test_amp_tidy_05
|
449
456
|
FeedTools.tidy_enabled = true
|
450
457
|
assert_equal(true, FeedTools.tidy_enabled?,
|
451
458
|
"Could not enable tidyhtml, library may be missing.")
|
452
|
-
|
453
|
-
|
454
|
-
|
459
|
+
with_feed(:from_file => 'wellformed/amp/amp05.xml') { |feed|
|
460
|
+
assert_equal("&", feed.entries.first.title)
|
461
|
+
}
|
455
462
|
end
|
456
463
|
|
457
464
|
def test_amp_tidy_06
|
458
465
|
FeedTools.tidy_enabled = true
|
459
466
|
assert_equal(true, FeedTools.tidy_enabled?,
|
460
467
|
"Could not enable tidyhtml, library may be missing.")
|
461
|
-
|
462
|
-
|
463
|
-
|
468
|
+
with_feed(:from_file => 'wellformed/amp/amp06.xml') { |feed|
|
469
|
+
assert_equal("&", feed.entries.first.title)
|
470
|
+
}
|
464
471
|
end
|
465
472
|
|
466
473
|
def test_amp_tidy_07
|
467
474
|
FeedTools.tidy_enabled = true
|
468
475
|
assert_equal(true, FeedTools.tidy_enabled?,
|
469
476
|
"Could not enable tidyhtml, library may be missing.")
|
470
|
-
|
471
|
-
|
472
|
-
|
477
|
+
with_feed(:from_file => 'wellformed/amp/amp07.xml') { |feed|
|
478
|
+
assert_equal("&", feed.entries.first.title)
|
479
|
+
}
|
473
480
|
end
|
474
481
|
|
475
482
|
def test_amp_tidy_08
|
476
483
|
FeedTools.tidy_enabled = true
|
477
484
|
assert_equal(true, FeedTools.tidy_enabled?,
|
478
485
|
"Could not enable tidyhtml, library may be missing.")
|
479
|
-
|
480
|
-
|
481
|
-
|
486
|
+
with_feed(:from_file => 'wellformed/amp/amp08.xml') { |feed|
|
487
|
+
assert_equal("&", feed.entries.first.title)
|
488
|
+
}
|
482
489
|
end
|
483
490
|
|
484
491
|
def test_amp_tidy_09
|
485
492
|
FeedTools.tidy_enabled = true
|
486
493
|
assert_equal(true, FeedTools.tidy_enabled?,
|
487
494
|
"Could not enable tidyhtml, library may be missing.")
|
488
|
-
|
489
|
-
|
490
|
-
|
495
|
+
with_feed(:from_file => 'wellformed/amp/amp09.xml') { |feed|
|
496
|
+
assert_equal("&", feed.entries.first.title)
|
497
|
+
}
|
491
498
|
end
|
492
499
|
|
493
500
|
def test_amp_tidy_10
|
494
501
|
FeedTools.tidy_enabled = true
|
495
502
|
assert_equal(true, FeedTools.tidy_enabled?,
|
496
503
|
"Could not enable tidyhtml, library may be missing.")
|
497
|
-
|
498
|
-
|
499
|
-
|
504
|
+
with_feed(:from_file => 'wellformed/amp/amp10.xml') { |feed|
|
505
|
+
assert_equal("&", feed.entries.first.title)
|
506
|
+
}
|
500
507
|
end
|
501
508
|
|
502
509
|
def test_amp_tidy_11
|
503
510
|
FeedTools.tidy_enabled = true
|
504
511
|
assert_equal(true, FeedTools.tidy_enabled?,
|
505
512
|
"Could not enable tidyhtml, library may be missing.")
|
506
|
-
|
507
|
-
|
508
|
-
|
513
|
+
with_feed(:from_file => 'wellformed/amp/amp11.xml') { |feed|
|
514
|
+
assert_equal("&", feed.entries.first.title)
|
515
|
+
}
|
509
516
|
end
|
510
517
|
|
511
518
|
def test_amp_tidy_12
|
512
519
|
FeedTools.tidy_enabled = true
|
513
520
|
assert_equal(true, FeedTools.tidy_enabled?,
|
514
521
|
"Could not enable tidyhtml, library may be missing.")
|
515
|
-
|
516
|
-
|
517
|
-
|
522
|
+
with_feed(:from_file => 'wellformed/amp/amp12.xml') { |feed|
|
523
|
+
assert_equal("&", feed.entries.first.title)
|
524
|
+
}
|
518
525
|
end
|
519
526
|
|
520
527
|
def test_amp_tidy_13
|
521
528
|
FeedTools.tidy_enabled = true
|
522
529
|
assert_equal(true, FeedTools.tidy_enabled?,
|
523
530
|
"Could not enable tidyhtml, library may be missing.")
|
524
|
-
|
525
|
-
|
526
|
-
|
531
|
+
with_feed(:from_file => 'wellformed/amp/amp13.xml') { |feed|
|
532
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
533
|
+
}
|
527
534
|
end
|
528
535
|
|
529
536
|
def test_amp_tidy_14
|
530
537
|
FeedTools.tidy_enabled = true
|
531
538
|
assert_equal(true, FeedTools.tidy_enabled?,
|
532
539
|
"Could not enable tidyhtml, library may be missing.")
|
533
|
-
|
534
|
-
|
535
|
-
|
540
|
+
with_feed(:from_file => 'wellformed/amp/amp14.xml') { |feed|
|
541
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
542
|
+
}
|
536
543
|
end
|
537
544
|
|
538
545
|
def test_amp_tidy_15
|
539
546
|
FeedTools.tidy_enabled = true
|
540
547
|
assert_equal(true, FeedTools.tidy_enabled?,
|
541
548
|
"Could not enable tidyhtml, library may be missing.")
|
542
|
-
|
543
|
-
|
544
|
-
|
549
|
+
with_feed(:from_file => 'wellformed/amp/amp15.xml') { |feed|
|
550
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
551
|
+
}
|
545
552
|
end
|
546
553
|
|
547
554
|
def test_amp_tidy_16
|
548
555
|
FeedTools.tidy_enabled = true
|
549
556
|
assert_equal(true, FeedTools.tidy_enabled?,
|
550
557
|
"Could not enable tidyhtml, library may be missing.")
|
551
|
-
|
552
|
-
|
553
|
-
|
558
|
+
with_feed(:from_file => 'wellformed/amp/amp16.xml') { |feed|
|
559
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
560
|
+
}
|
554
561
|
end
|
555
562
|
|
556
563
|
def test_amp_tidy_17
|
557
564
|
FeedTools.tidy_enabled = true
|
558
565
|
assert_equal(true, FeedTools.tidy_enabled?,
|
559
566
|
"Could not enable tidyhtml, library may be missing.")
|
560
|
-
|
561
|
-
|
562
|
-
|
567
|
+
with_feed(:from_file => 'wellformed/amp/amp17.xml') { |feed|
|
568
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
569
|
+
}
|
563
570
|
end
|
564
571
|
|
565
572
|
def test_amp_tidy_18
|
566
573
|
FeedTools.tidy_enabled = true
|
567
574
|
assert_equal(true, FeedTools.tidy_enabled?,
|
568
575
|
"Could not enable tidyhtml, library may be missing.")
|
569
|
-
|
570
|
-
|
571
|
-
|
576
|
+
with_feed(:from_file => 'wellformed/amp/amp18.xml') { |feed|
|
577
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
578
|
+
}
|
572
579
|
end
|
573
580
|
|
574
581
|
def test_amp_tidy_19
|
575
582
|
FeedTools.tidy_enabled = true
|
576
583
|
assert_equal(true, FeedTools.tidy_enabled?,
|
577
584
|
"Could not enable tidyhtml, library may be missing.")
|
578
|
-
|
579
|
-
|
580
|
-
|
585
|
+
with_feed(:from_file => 'wellformed/amp/amp19.xml') { |feed|
|
586
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
587
|
+
}
|
581
588
|
end
|
582
589
|
|
583
590
|
def test_amp_tidy_20
|
584
591
|
FeedTools.tidy_enabled = true
|
585
592
|
assert_equal(true, FeedTools.tidy_enabled?,
|
586
593
|
"Could not enable tidyhtml, library may be missing.")
|
587
|
-
|
588
|
-
|
589
|
-
|
594
|
+
with_feed(:from_file => 'wellformed/amp/amp20.xml') { |feed|
|
595
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
596
|
+
}
|
590
597
|
end
|
591
598
|
|
592
599
|
def test_amp_tidy_21
|
593
600
|
FeedTools.tidy_enabled = true
|
594
601
|
assert_equal(true, FeedTools.tidy_enabled?,
|
595
602
|
"Could not enable tidyhtml, library may be missing.")
|
596
|
-
|
597
|
-
|
598
|
-
|
603
|
+
with_feed(:from_file => 'wellformed/amp/amp21.xml') { |feed|
|
604
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
605
|
+
}
|
599
606
|
end
|
600
607
|
|
601
608
|
def test_amp_tidy_22
|
602
609
|
FeedTools.tidy_enabled = true
|
603
610
|
assert_equal(true, FeedTools.tidy_enabled?,
|
604
611
|
"Could not enable tidyhtml, library may be missing.")
|
605
|
-
|
606
|
-
|
607
|
-
|
612
|
+
with_feed(:from_file => 'wellformed/amp/amp22.xml') { |feed|
|
613
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
614
|
+
}
|
608
615
|
end
|
609
616
|
|
610
617
|
def test_amp_tidy_23
|
611
618
|
FeedTools.tidy_enabled = true
|
612
619
|
assert_equal(true, FeedTools.tidy_enabled?,
|
613
620
|
"Could not enable tidyhtml, library may be missing.")
|
614
|
-
|
615
|
-
|
616
|
-
|
621
|
+
with_feed(:from_file => 'wellformed/amp/amp23.xml') { |feed|
|
622
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
623
|
+
}
|
617
624
|
end
|
618
625
|
|
619
626
|
def test_amp_tidy_24
|
620
627
|
FeedTools.tidy_enabled = true
|
621
628
|
assert_equal(true, FeedTools.tidy_enabled?,
|
622
629
|
"Could not enable tidyhtml, library may be missing.")
|
623
|
-
|
624
|
-
|
625
|
-
|
630
|
+
with_feed(:from_file => 'wellformed/amp/amp24.xml') { |feed|
|
631
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
632
|
+
}
|
626
633
|
end
|
627
634
|
|
628
635
|
def test_amp_tidy_25
|
629
636
|
FeedTools.tidy_enabled = true
|
630
637
|
assert_equal(true, FeedTools.tidy_enabled?,
|
631
638
|
"Could not enable tidyhtml, library may be missing.")
|
632
|
-
|
633
|
-
|
634
|
-
|
639
|
+
with_feed(:from_file => 'wellformed/amp/amp25.xml') { |feed|
|
640
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
641
|
+
}
|
635
642
|
end
|
636
643
|
|
637
644
|
def test_amp_tidy_26
|
638
645
|
FeedTools.tidy_enabled = true
|
639
646
|
assert_equal(true, FeedTools.tidy_enabled?,
|
640
647
|
"Could not enable tidyhtml, library may be missing.")
|
641
|
-
|
642
|
-
|
643
|
-
|
648
|
+
with_feed(:from_file => 'wellformed/amp/amp26.xml') { |feed|
|
649
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
650
|
+
}
|
644
651
|
end
|
645
652
|
|
646
653
|
def test_amp_tidy_27
|
647
654
|
FeedTools.tidy_enabled = true
|
648
655
|
assert_equal(true, FeedTools.tidy_enabled?,
|
649
656
|
"Could not enable tidyhtml, library may be missing.")
|
650
|
-
|
651
|
-
|
652
|
-
|
657
|
+
with_feed(:from_file => 'wellformed/amp/amp27.xml') { |feed|
|
658
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
659
|
+
}
|
653
660
|
end
|
654
661
|
|
655
662
|
def test_amp_tidy_28
|
656
663
|
FeedTools.tidy_enabled = true
|
657
664
|
assert_equal(true, FeedTools.tidy_enabled?,
|
658
665
|
"Could not enable tidyhtml, library may be missing.")
|
659
|
-
|
660
|
-
|
661
|
-
|
666
|
+
with_feed(:from_file => 'wellformed/amp/amp28.xml') { |feed|
|
667
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
668
|
+
}
|
662
669
|
end
|
663
670
|
|
664
671
|
def test_amp_tidy_29
|
665
672
|
FeedTools.tidy_enabled = true
|
666
673
|
assert_equal(true, FeedTools.tidy_enabled?,
|
667
674
|
"Could not enable tidyhtml, library may be missing.")
|
668
|
-
|
669
|
-
|
670
|
-
|
675
|
+
with_feed(:from_file => 'wellformed/amp/amp29.xml') { |feed|
|
676
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
677
|
+
}
|
671
678
|
end
|
672
679
|
|
673
680
|
def test_amp_tidy_30
|
674
681
|
FeedTools.tidy_enabled = true
|
675
682
|
assert_equal(true, FeedTools.tidy_enabled?,
|
676
683
|
"Could not enable tidyhtml, library may be missing.")
|
677
|
-
|
678
|
-
|
679
|
-
|
684
|
+
with_feed(:from_file => 'wellformed/amp/amp30.xml') { |feed|
|
685
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
686
|
+
}
|
680
687
|
end
|
681
688
|
|
682
689
|
def test_amp_tidy_31
|
683
690
|
FeedTools.tidy_enabled = true
|
684
691
|
assert_equal(true, FeedTools.tidy_enabled?,
|
685
692
|
"Could not enable tidyhtml, library may be missing.")
|
686
|
-
|
687
|
-
|
688
|
-
|
693
|
+
with_feed(:from_file => 'wellformed/amp/amp31.xml') { |feed|
|
694
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
695
|
+
}
|
689
696
|
end
|
690
697
|
|
691
698
|
def test_amp_tidy_32
|
692
699
|
FeedTools.tidy_enabled = true
|
693
700
|
assert_equal(true, FeedTools.tidy_enabled?,
|
694
701
|
"Could not enable tidyhtml, library may be missing.")
|
695
|
-
|
696
|
-
|
697
|
-
|
702
|
+
with_feed(:from_file => 'wellformed/amp/amp32.xml') { |feed|
|
703
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
704
|
+
}
|
698
705
|
end
|
699
706
|
|
700
707
|
def test_amp_tidy_33
|
701
708
|
FeedTools.tidy_enabled = true
|
702
709
|
assert_equal(true, FeedTools.tidy_enabled?,
|
703
710
|
"Could not enable tidyhtml, library may be missing.")
|
704
|
-
|
705
|
-
|
706
|
-
|
711
|
+
with_feed(:from_file => 'wellformed/amp/amp33.xml') { |feed|
|
712
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
713
|
+
}
|
707
714
|
end
|
708
715
|
|
709
716
|
def test_amp_tidy_34
|
710
717
|
FeedTools.tidy_enabled = true
|
711
718
|
assert_equal(true, FeedTools.tidy_enabled?,
|
712
719
|
"Could not enable tidyhtml, library may be missing.")
|
713
|
-
|
714
|
-
|
715
|
-
|
720
|
+
with_feed(:from_file => 'wellformed/amp/amp34.xml') { |feed|
|
721
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
722
|
+
}
|
716
723
|
end
|
717
724
|
|
718
725
|
def test_amp_tidy_35
|
719
726
|
FeedTools.tidy_enabled = true
|
720
727
|
assert_equal(true, FeedTools.tidy_enabled?,
|
721
728
|
"Could not enable tidyhtml, library may be missing.")
|
722
|
-
|
723
|
-
|
724
|
-
|
729
|
+
with_feed(:from_file => 'wellformed/amp/amp35.xml') { |feed|
|
730
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
731
|
+
}
|
725
732
|
end
|
726
733
|
|
727
734
|
def test_amp_tidy_36
|
728
735
|
FeedTools.tidy_enabled = true
|
729
736
|
assert_equal(true, FeedTools.tidy_enabled?,
|
730
737
|
"Could not enable tidyhtml, library may be missing.")
|
731
|
-
|
732
|
-
|
733
|
-
|
738
|
+
with_feed(:from_file => 'wellformed/amp/amp36.xml') { |feed|
|
739
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
740
|
+
}
|
734
741
|
end
|
735
742
|
|
736
743
|
def test_amp_tidy_37
|
737
744
|
FeedTools.tidy_enabled = true
|
738
745
|
assert_equal(true, FeedTools.tidy_enabled?,
|
739
746
|
"Could not enable tidyhtml, library may be missing.")
|
740
|
-
|
741
|
-
|
742
|
-
|
747
|
+
with_feed(:from_file => 'wellformed/amp/amp37.xml') { |feed|
|
748
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
749
|
+
}
|
743
750
|
end
|
744
751
|
|
745
752
|
def test_amp_tidy_38
|
746
753
|
FeedTools.tidy_enabled = true
|
747
754
|
assert_equal(true, FeedTools.tidy_enabled?,
|
748
755
|
"Could not enable tidyhtml, library may be missing.")
|
749
|
-
|
750
|
-
|
751
|
-
|
756
|
+
with_feed(:from_file => 'wellformed/amp/amp38.xml') { |feed|
|
757
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
758
|
+
}
|
752
759
|
end
|
753
760
|
|
754
761
|
def test_amp_tidy_39
|
755
762
|
FeedTools.tidy_enabled = true
|
756
763
|
assert_equal(true, FeedTools.tidy_enabled?,
|
757
764
|
"Could not enable tidyhtml, library may be missing.")
|
758
|
-
|
759
|
-
|
760
|
-
|
765
|
+
with_feed(:from_file => 'wellformed/amp/amp39.xml') { |feed|
|
766
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
767
|
+
}
|
761
768
|
end
|
762
769
|
|
763
770
|
def test_amp_tidy_40
|
764
771
|
FeedTools.tidy_enabled = true
|
765
772
|
assert_equal(true, FeedTools.tidy_enabled?,
|
766
773
|
"Could not enable tidyhtml, library may be missing.")
|
767
|
-
|
768
|
-
|
769
|
-
|
774
|
+
with_feed(:from_file => 'wellformed/amp/amp40.xml') { |feed|
|
775
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
776
|
+
}
|
770
777
|
end
|
771
778
|
|
772
779
|
def test_amp_tidy_41
|
773
780
|
FeedTools.tidy_enabled = true
|
774
781
|
assert_equal(true, FeedTools.tidy_enabled?,
|
775
782
|
"Could not enable tidyhtml, library may be missing.")
|
776
|
-
|
777
|
-
|
778
|
-
|
783
|
+
with_feed(:from_file => 'wellformed/amp/amp41.xml') { |feed|
|
784
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
785
|
+
}
|
779
786
|
end
|
780
787
|
|
781
788
|
def test_amp_tidy_42
|
782
789
|
FeedTools.tidy_enabled = true
|
783
790
|
assert_equal(true, FeedTools.tidy_enabled?,
|
784
791
|
"Could not enable tidyhtml, library may be missing.")
|
785
|
-
|
786
|
-
|
787
|
-
|
792
|
+
with_feed(:from_file => 'wellformed/amp/amp42.xml') { |feed|
|
793
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
794
|
+
}
|
788
795
|
end
|
789
796
|
|
790
797
|
def test_amp_tidy_43
|
791
798
|
FeedTools.tidy_enabled = true
|
792
799
|
assert_equal(true, FeedTools.tidy_enabled?,
|
793
800
|
"Could not enable tidyhtml, library may be missing.")
|
794
|
-
|
795
|
-
|
796
|
-
|
801
|
+
with_feed(:from_file => 'wellformed/amp/amp43.xml') { |feed|
|
802
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
803
|
+
}
|
797
804
|
end
|
798
805
|
|
799
806
|
def test_amp_tidy_44
|
800
807
|
FeedTools.tidy_enabled = true
|
801
808
|
assert_equal(true, FeedTools.tidy_enabled?,
|
802
809
|
"Could not enable tidyhtml, library may be missing.")
|
803
|
-
|
804
|
-
|
805
|
-
|
810
|
+
with_feed(:from_file => 'wellformed/amp/amp44.xml') { |feed|
|
811
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
812
|
+
}
|
806
813
|
end
|
807
814
|
|
808
815
|
def test_amp_tidy_45
|
809
816
|
FeedTools.tidy_enabled = true
|
810
817
|
assert_equal(true, FeedTools.tidy_enabled?,
|
811
818
|
"Could not enable tidyhtml, library may be missing.")
|
812
|
-
|
813
|
-
|
814
|
-
|
819
|
+
with_feed(:from_file => 'wellformed/amp/amp45.xml') { |feed|
|
820
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
821
|
+
}
|
815
822
|
end
|
816
823
|
|
817
824
|
def test_amp_tidy_46
|
818
825
|
FeedTools.tidy_enabled = true
|
819
826
|
assert_equal(true, FeedTools.tidy_enabled?,
|
820
827
|
"Could not enable tidyhtml, library may be missing.")
|
821
|
-
|
822
|
-
|
823
|
-
|
828
|
+
with_feed(:from_file => 'wellformed/amp/amp46.xml') { |feed|
|
829
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
830
|
+
}
|
824
831
|
end
|
825
832
|
|
826
833
|
def test_amp_tidy_47
|
827
834
|
FeedTools.tidy_enabled = true
|
828
835
|
assert_equal(true, FeedTools.tidy_enabled?,
|
829
836
|
"Could not enable tidyhtml, library may be missing.")
|
830
|
-
|
831
|
-
|
832
|
-
|
837
|
+
with_feed(:from_file => 'wellformed/amp/amp47.xml') { |feed|
|
838
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
839
|
+
}
|
833
840
|
end
|
834
841
|
|
835
842
|
def test_amp_tidy_48
|
836
843
|
FeedTools.tidy_enabled = true
|
837
844
|
assert_equal(true, FeedTools.tidy_enabled?,
|
838
845
|
"Could not enable tidyhtml, library may be missing.")
|
839
|
-
|
840
|
-
|
841
|
-
|
846
|
+
with_feed(:from_file => 'wellformed/amp/amp48.xml') { |feed|
|
847
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
848
|
+
}
|
842
849
|
end
|
843
850
|
|
844
851
|
def test_amp_tidy_49
|
845
852
|
FeedTools.tidy_enabled = true
|
846
853
|
assert_equal(true, FeedTools.tidy_enabled?,
|
847
854
|
"Could not enable tidyhtml, library may be missing.")
|
848
|
-
|
849
|
-
|
850
|
-
|
855
|
+
with_feed(:from_file => 'wellformed/amp/amp49.xml') { |feed|
|
856
|
+
assert_equal("&", feed.entries.first.title)
|
857
|
+
}
|
851
858
|
end
|
852
859
|
|
853
860
|
def test_amp_tidy_50
|
854
861
|
FeedTools.tidy_enabled = true
|
855
862
|
assert_equal(true, FeedTools.tidy_enabled?,
|
856
863
|
"Could not enable tidyhtml, library may be missing.")
|
857
|
-
|
858
|
-
|
859
|
-
|
864
|
+
with_feed(:from_file => 'wellformed/amp/amp50.xml') { |feed|
|
865
|
+
assert_equal("&", feed.entries.first.title)
|
866
|
+
}
|
860
867
|
end
|
861
868
|
|
862
869
|
def test_amp_tidy_51
|
863
870
|
FeedTools.tidy_enabled = true
|
864
871
|
assert_equal(true, FeedTools.tidy_enabled?,
|
865
872
|
"Could not enable tidyhtml, library may be missing.")
|
866
|
-
|
867
|
-
|
868
|
-
|
873
|
+
with_feed(:from_file => 'wellformed/amp/amp51.xml') { |feed|
|
874
|
+
assert_equal("&", feed.entries.first.title)
|
875
|
+
}
|
869
876
|
end
|
870
877
|
|
871
878
|
def test_amp_tidy_52
|
872
879
|
FeedTools.tidy_enabled = true
|
873
880
|
assert_equal(true, FeedTools.tidy_enabled?,
|
874
881
|
"Could not enable tidyhtml, library may be missing.")
|
875
|
-
|
876
|
-
|
877
|
-
|
882
|
+
with_feed(:from_file => 'wellformed/amp/amp52.xml') { |feed|
|
883
|
+
assert_equal("&", feed.entries.first.title)
|
884
|
+
}
|
878
885
|
end
|
879
886
|
|
880
887
|
def test_amp_tidy_53
|
881
888
|
FeedTools.tidy_enabled = true
|
882
889
|
assert_equal(true, FeedTools.tidy_enabled?,
|
883
890
|
"Could not enable tidyhtml, library may be missing.")
|
884
|
-
|
885
|
-
|
886
|
-
|
891
|
+
with_feed(:from_file => 'wellformed/amp/amp53.xml') { |feed|
|
892
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
893
|
+
}
|
887
894
|
end
|
888
895
|
|
889
896
|
def test_amp_tidy_54
|
890
897
|
FeedTools.tidy_enabled = true
|
891
898
|
assert_equal(true, FeedTools.tidy_enabled?,
|
892
899
|
"Could not enable tidyhtml, library may be missing.")
|
893
|
-
|
894
|
-
|
895
|
-
|
900
|
+
with_feed(:from_file => 'wellformed/amp/amp54.xml') { |feed|
|
901
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
902
|
+
}
|
896
903
|
end
|
897
904
|
|
898
905
|
def test_amp_tidy_55
|
899
906
|
FeedTools.tidy_enabled = true
|
900
907
|
assert_equal(true, FeedTools.tidy_enabled?,
|
901
908
|
"Could not enable tidyhtml, library may be missing.")
|
902
|
-
|
903
|
-
|
904
|
-
|
909
|
+
with_feed(:from_file => 'wellformed/amp/amp55.xml') { |feed|
|
910
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
911
|
+
}
|
905
912
|
end
|
906
913
|
|
907
914
|
def test_amp_tidy_56
|
908
915
|
FeedTools.tidy_enabled = true
|
909
916
|
assert_equal(true, FeedTools.tidy_enabled?,
|
910
917
|
"Could not enable tidyhtml, library may be missing.")
|
911
|
-
|
912
|
-
|
913
|
-
|
918
|
+
with_feed(:from_file => 'wellformed/amp/amp56.xml') { |feed|
|
919
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
920
|
+
}
|
914
921
|
end
|
915
922
|
|
916
923
|
def test_amp_tidy_57
|
917
924
|
FeedTools.tidy_enabled = true
|
918
925
|
assert_equal(true, FeedTools.tidy_enabled?,
|
919
926
|
"Could not enable tidyhtml, library may be missing.")
|
920
|
-
|
921
|
-
|
922
|
-
|
927
|
+
with_feed(:from_file => 'wellformed/amp/amp57.xml') { |feed|
|
928
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
929
|
+
}
|
923
930
|
end
|
924
931
|
|
925
932
|
def test_amp_tidy_58
|
926
933
|
FeedTools.tidy_enabled = true
|
927
934
|
assert_equal(true, FeedTools.tidy_enabled?,
|
928
935
|
"Could not enable tidyhtml, library may be missing.")
|
929
|
-
|
930
|
-
|
931
|
-
|
936
|
+
with_feed(:from_file => 'wellformed/amp/amp58.xml') { |feed|
|
937
|
+
assert_equal("<strong>&</strong>", feed.entries.first.title)
|
938
|
+
}
|
932
939
|
end
|
933
940
|
|
934
941
|
def test_amp_tidy_59
|
935
942
|
FeedTools.tidy_enabled = true
|
936
943
|
assert_equal(true, FeedTools.tidy_enabled?,
|
937
944
|
"Could not enable tidyhtml, library may be missing.")
|
938
|
-
|
939
|
-
|
940
|
-
|
945
|
+
with_feed(:from_file => 'wellformed/amp/amp59.xml') { |feed|
|
946
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
947
|
+
}
|
941
948
|
end
|
942
949
|
|
943
950
|
def test_amp_tidy_60
|
944
951
|
FeedTools.tidy_enabled = true
|
945
952
|
assert_equal(true, FeedTools.tidy_enabled?,
|
946
953
|
"Could not enable tidyhtml, library may be missing.")
|
947
|
-
|
948
|
-
|
949
|
-
|
954
|
+
with_feed(:from_file => 'wellformed/amp/amp60.xml') { |feed|
|
955
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
956
|
+
}
|
950
957
|
end
|
951
958
|
|
952
959
|
def test_amp_tidy_61
|
953
960
|
FeedTools.tidy_enabled = true
|
954
961
|
assert_equal(true, FeedTools.tidy_enabled?,
|
955
962
|
"Could not enable tidyhtml, library may be missing.")
|
956
|
-
|
957
|
-
|
958
|
-
|
963
|
+
with_feed(:from_file => 'wellformed/amp/amp61.xml') { |feed|
|
964
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
965
|
+
}
|
959
966
|
end
|
960
967
|
|
961
968
|
def test_amp_tidy_62
|
962
969
|
FeedTools.tidy_enabled = true
|
963
970
|
assert_equal(true, FeedTools.tidy_enabled?,
|
964
971
|
"Could not enable tidyhtml, library may be missing.")
|
965
|
-
|
966
|
-
|
967
|
-
|
972
|
+
with_feed(:from_file => 'wellformed/amp/amp62.xml') { |feed|
|
973
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
974
|
+
}
|
968
975
|
end
|
969
976
|
|
970
977
|
def test_amp_tidy_63
|
971
978
|
FeedTools.tidy_enabled = true
|
972
979
|
assert_equal(true, FeedTools.tidy_enabled?,
|
973
980
|
"Could not enable tidyhtml, library may be missing.")
|
974
|
-
|
975
|
-
|
976
|
-
|
981
|
+
with_feed(:from_file => 'wellformed/amp/amp63.xml') { |feed|
|
982
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
983
|
+
}
|
977
984
|
end
|
978
985
|
|
979
986
|
def test_amp_tidy_64
|
980
987
|
FeedTools.tidy_enabled = true
|
981
988
|
assert_equal(true, FeedTools.tidy_enabled?,
|
982
989
|
"Could not enable tidyhtml, library may be missing.")
|
983
|
-
|
984
|
-
|
985
|
-
|
990
|
+
with_feed(:from_file => 'wellformed/amp/amp64.xml') { |feed|
|
991
|
+
assert_equal("<div><strong>&</strong></div>", feed.entries.first.title)
|
992
|
+
}
|
986
993
|
end
|
987
994
|
|
988
995
|
def test_amp_tidy_65
|
989
996
|
FeedTools.tidy_enabled = true
|
990
997
|
assert_equal(true, FeedTools.tidy_enabled?,
|
991
998
|
"Could not enable tidyhtml, library may be missing.")
|
992
|
-
|
993
|
-
feed.feed_data = <<-FEED
|
999
|
+
with_feed(:from_data => <<-FEED
|
994
1000
|
<feed version="0.3">
|
995
1001
|
<title><strong>1 &amp; 2 & 3</strong></title>
|
996
1002
|
<tagline><strong>1 &amp; 2 & 3</strong></tagline>
|
@@ -1000,9 +1006,11 @@ class AmpTest < Test::Unit::TestCase
|
|
1000
1006
|
</entry>
|
1001
1007
|
</feed>
|
1002
1008
|
FEED
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
+
) { |feed|
|
1010
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.title)
|
1011
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.tagline)
|
1012
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.entries.first.title)
|
1013
|
+
assert_equal("<strong>1 & 2 & 3</strong>", feed.entries.first.content)
|
1014
|
+
}
|
1015
|
+
end
|
1016
|
+
end
|