rss 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +38 -0
- data/README.md +11 -11
- data/lib/rss/itunes.rb +10 -1
- data/lib/rss/maker/itunes.rb +2 -0
- data/lib/rss/rss.rb +43 -15
- data/lib/rss/utils.rb +0 -18
- data/lib/rss/version.rb +1 -1
- data/lib/rss/xml-stylesheet.rb +3 -4
- data/lib/rss/xml.rb +3 -2
- data/lib/rss.rb +11 -11
- metadata +7 -101
- data/Gemfile +0 -6
- data/Rakefile +0 -15
- data/rss.gemspec +0 -30
- data/test/dot.png +0 -0
- data/test/rss-assertions.rb +0 -2116
- data/test/rss-testcase.rb +0 -479
- data/test/run-test.rb +0 -15
- data/test/test_1.0.rb +0 -308
- data/test/test_2.0.rb +0 -412
- data/test/test_accessor.rb +0 -104
- data/test/test_atom.rb +0 -684
- data/test/test_content.rb +0 -105
- data/test/test_dublincore.rb +0 -270
- data/test/test_image.rb +0 -215
- data/test/test_inherit.rb +0 -41
- data/test/test_itunes.rb +0 -360
- data/test/test_maker_0.9.rb +0 -477
- data/test/test_maker_1.0.rb +0 -519
- data/test/test_maker_2.0.rb +0 -758
- data/test/test_maker_atom_entry.rb +0 -394
- data/test/test_maker_atom_feed.rb +0 -455
- data/test/test_maker_content.rb +0 -48
- data/test/test_maker_dc.rb +0 -150
- data/test/test_maker_image.rb +0 -63
- data/test/test_maker_itunes.rb +0 -488
- data/test/test_maker_slash.rb +0 -38
- data/test/test_maker_sy.rb +0 -45
- data/test/test_maker_taxo.rb +0 -82
- data/test/test_maker_trackback.rb +0 -42
- data/test/test_maker_xml-stylesheet.rb +0 -84
- data/test/test_parser.rb +0 -122
- data/test/test_parser_1.0.rb +0 -529
- data/test/test_parser_2.0.rb +0 -123
- data/test/test_parser_atom_entry.rb +0 -164
- data/test/test_parser_atom_feed.rb +0 -277
- data/test/test_setup_maker_0.9.rb +0 -247
- data/test/test_setup_maker_1.0.rb +0 -551
- data/test/test_setup_maker_2.0.rb +0 -309
- data/test/test_setup_maker_atom_entry.rb +0 -410
- data/test/test_setup_maker_atom_feed.rb +0 -446
- data/test/test_setup_maker_itunes.rb +0 -146
- data/test/test_setup_maker_slash.rb +0 -39
- data/test/test_slash.rb +0 -65
- data/test/test_syndication.rb +0 -126
- data/test/test_taxonomy.rb +0 -173
- data/test/test_to_s.rb +0 -701
- data/test/test_trackback.rb +0 -136
- data/test/test_xml-stylesheet.rb +0 -109
@@ -1,551 +0,0 @@
|
|
1
|
-
# frozen_string_literal: false
|
2
|
-
require_relative "rss-testcase"
|
3
|
-
|
4
|
-
require "rss/maker"
|
5
|
-
|
6
|
-
module RSS
|
7
|
-
class TestSetupMaker10 < TestCase
|
8
|
-
|
9
|
-
def setup
|
10
|
-
t = Time.iso8601("2000-01-01T12:00:05+00:00")
|
11
|
-
class << t
|
12
|
-
alias_method(:to_s, :iso8601)
|
13
|
-
end
|
14
|
-
|
15
|
-
@dc_elems = {
|
16
|
-
:title => "hoge",
|
17
|
-
:description =>
|
18
|
-
" XML is placing increasingly heavy loads on
|
19
|
-
the existing technical infrastructure of the Internet.",
|
20
|
-
:creator => "Rael Dornfest (mailto:rael@oreilly.com)",
|
21
|
-
:subject => "XML",
|
22
|
-
:publisher => "The O'Reilly Network",
|
23
|
-
:contributor => "hogehoge",
|
24
|
-
:type => "fugafuga",
|
25
|
-
:format => "hohoho",
|
26
|
-
:identifier => "fufufu",
|
27
|
-
:source => "barbar",
|
28
|
-
:language => "ja",
|
29
|
-
:relation => "cococo",
|
30
|
-
:rights => "Copyright (c) 2000 O'Reilly & Associates, Inc.",
|
31
|
-
:date => t,
|
32
|
-
}
|
33
|
-
|
34
|
-
@sy_elems = {
|
35
|
-
:updatePeriod => "hourly",
|
36
|
-
:updateFrequency => "2",
|
37
|
-
:updateBase => t,
|
38
|
-
}
|
39
|
-
|
40
|
-
@content_elems = {
|
41
|
-
:encoded => "<em>ATTENTION</em>",
|
42
|
-
}
|
43
|
-
|
44
|
-
@trackback_elems = {
|
45
|
-
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
|
46
|
-
:about => [
|
47
|
-
"http://foo.com/trackback/tb.cgi?tb_id=20020923",
|
48
|
-
"http://foo.com/trackback/tb.cgi?tb_id=20021010",
|
49
|
-
],
|
50
|
-
}
|
51
|
-
|
52
|
-
@taxo_topic_elems = [
|
53
|
-
{
|
54
|
-
:link => "http://meerkat.oreillynet.com/?c=cat23",
|
55
|
-
:title => "Data: XML",
|
56
|
-
:description => "A Meerkat channel",
|
57
|
-
},
|
58
|
-
{
|
59
|
-
:link => "http://dmoz.org/Computers/Data_Formats/Markup_Languages/XML/",
|
60
|
-
:title => "XML",
|
61
|
-
:subject => "XML",
|
62
|
-
:description => "DMOZ category",
|
63
|
-
:topics => [
|
64
|
-
"http://meerkat.oreillynet.com/?c=cat23",
|
65
|
-
"http://dmoz.org/Computers/Data_Formats/Markup_Languages/SGML/",
|
66
|
-
"http://dmoz.org/Computers/Programming/Internet/",
|
67
|
-
]
|
68
|
-
},
|
69
|
-
]
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_setup_maker_channel
|
73
|
-
about = "http://hoge.com"
|
74
|
-
title = "fugafuga"
|
75
|
-
link = "http://hoge.com"
|
76
|
-
description = "fugafugafugafuga"
|
77
|
-
|
78
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
79
|
-
maker.channel.about = about
|
80
|
-
maker.channel.title = title
|
81
|
-
maker.channel.link = link
|
82
|
-
maker.channel.description = description
|
83
|
-
|
84
|
-
@dc_elems.each do |var, value|
|
85
|
-
maker.channel.__send__("dc_#{var}=", value)
|
86
|
-
end
|
87
|
-
|
88
|
-
@sy_elems.each do |var, value|
|
89
|
-
maker.channel.__send__("sy_#{var}=", value)
|
90
|
-
end
|
91
|
-
|
92
|
-
setup_dummy_item(maker)
|
93
|
-
end
|
94
|
-
|
95
|
-
new_rss = RSS::Maker.make("1.0") do |maker|
|
96
|
-
rss.channel.setup_maker(maker)
|
97
|
-
rss.items.each do |item|
|
98
|
-
item.setup_maker(maker)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
channel = new_rss.channel
|
102
|
-
|
103
|
-
assert_equal(about, channel.about)
|
104
|
-
assert_equal(title, channel.title)
|
105
|
-
assert_equal(link, channel.link)
|
106
|
-
assert_equal(description, channel.description)
|
107
|
-
assert_equal(1, channel.items.Seq.lis.size)
|
108
|
-
assert_nil(channel.image)
|
109
|
-
assert_nil(channel.textinput)
|
110
|
-
|
111
|
-
@dc_elems.each do |var, value|
|
112
|
-
assert_equal(value, channel.__send__("dc_#{var}"))
|
113
|
-
end
|
114
|
-
|
115
|
-
@sy_elems.each do |var, value|
|
116
|
-
value = value.to_i if var == :updateFrequency
|
117
|
-
assert_equal(value, channel.__send__("sy_#{var}"))
|
118
|
-
end
|
119
|
-
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_setup_maker_image
|
123
|
-
title = "fugafuga"
|
124
|
-
link = "http://hoge.com"
|
125
|
-
url = "http://hoge.com/hoge.png"
|
126
|
-
|
127
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
128
|
-
setup_dummy_channel(maker)
|
129
|
-
maker.channel.link = link
|
130
|
-
|
131
|
-
maker.image.title = title
|
132
|
-
maker.image.url = url
|
133
|
-
|
134
|
-
@dc_elems.each do |var, value|
|
135
|
-
maker.image.__send__("dc_#{var}=", value)
|
136
|
-
end
|
137
|
-
|
138
|
-
setup_dummy_item(maker)
|
139
|
-
end
|
140
|
-
|
141
|
-
new_rss = RSS::Maker.make("1.0") do |maker|
|
142
|
-
rss.channel.setup_maker(maker)
|
143
|
-
rss.image.setup_maker(maker)
|
144
|
-
rss.items.each do |item|
|
145
|
-
item.setup_maker(maker)
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
image = new_rss.image
|
150
|
-
assert_equal(url, image.about)
|
151
|
-
assert_equal(url, new_rss.channel.image.resource)
|
152
|
-
assert_equal(title, image.title)
|
153
|
-
assert_equal(link, image.link)
|
154
|
-
assert_equal(url, image.url)
|
155
|
-
|
156
|
-
@dc_elems.each do |var, value|
|
157
|
-
assert_equal(image.__send__("dc_#{var}"), value)
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
def test_setup_maker_textinput
|
162
|
-
title = "fugafuga"
|
163
|
-
description = "text hoge fuga"
|
164
|
-
name = "hoge"
|
165
|
-
link = "http://hoge.com"
|
166
|
-
|
167
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
168
|
-
setup_dummy_channel(maker)
|
169
|
-
|
170
|
-
maker.textinput.link = link
|
171
|
-
maker.textinput.title = title
|
172
|
-
maker.textinput.description = description
|
173
|
-
maker.textinput.name = name
|
174
|
-
|
175
|
-
@dc_elems.each do |var, value|
|
176
|
-
maker.textinput.__send__("dc_#{var}=", value)
|
177
|
-
end
|
178
|
-
|
179
|
-
setup_dummy_item(maker)
|
180
|
-
end
|
181
|
-
|
182
|
-
new_rss = RSS::Maker.make("1.0") do |maker|
|
183
|
-
rss.channel.setup_maker(maker)
|
184
|
-
rss.textinput.setup_maker(maker)
|
185
|
-
rss.items.each do |item|
|
186
|
-
item.setup_maker(maker)
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
textinput = new_rss.textinput
|
191
|
-
assert_equal(link, textinput.about)
|
192
|
-
assert_equal(link, new_rss.channel.textinput.resource)
|
193
|
-
assert_equal(title, textinput.title)
|
194
|
-
assert_equal(name, textinput.name)
|
195
|
-
assert_equal(description, textinput.description)
|
196
|
-
assert_equal(link, textinput.link)
|
197
|
-
|
198
|
-
@dc_elems.each do |var, value|
|
199
|
-
assert_equal(textinput.__send__("dc_#{var}"), value)
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
|
-
def test_setup_maker_items(for_backward_compatibility=false)
|
204
|
-
title = "TITLE"
|
205
|
-
link = "http://hoge.com/"
|
206
|
-
description = "text hoge fuga"
|
207
|
-
|
208
|
-
item_size = 5
|
209
|
-
|
210
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
211
|
-
setup_dummy_channel(maker)
|
212
|
-
|
213
|
-
item_size.times do |i|
|
214
|
-
maker.items.new_item do |item|
|
215
|
-
item.title = "#{title}#{i}"
|
216
|
-
item.link = "#{link}#{i}"
|
217
|
-
item.description = "#{description}#{i}"
|
218
|
-
|
219
|
-
@dc_elems.each do |var, value|
|
220
|
-
item.__send__("dc_#{var}=", value)
|
221
|
-
end
|
222
|
-
|
223
|
-
@content_elems.each do |var, value|
|
224
|
-
item.__send__("content_#{var}=", value)
|
225
|
-
end
|
226
|
-
|
227
|
-
item.trackback_ping = @trackback_elems[:ping]
|
228
|
-
@trackback_elems[:about].each do |value|
|
229
|
-
item.trackback_abouts.new_about do |new_about|
|
230
|
-
new_about.value = value
|
231
|
-
end
|
232
|
-
end
|
233
|
-
end
|
234
|
-
end
|
235
|
-
end
|
236
|
-
|
237
|
-
new_rss = RSS::Maker.make("1.0") do |maker|
|
238
|
-
rss.channel.setup_maker(maker)
|
239
|
-
|
240
|
-
rss.items.each do |item|
|
241
|
-
if for_backward_compatibility
|
242
|
-
item.setup_maker(maker)
|
243
|
-
else
|
244
|
-
item.setup_maker(maker.items)
|
245
|
-
end
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
assert_equal(item_size, new_rss.items.size)
|
250
|
-
new_rss.items.each_with_index do |item, i|
|
251
|
-
assert_equal("#{link}#{i}", item.about)
|
252
|
-
assert_equal("#{title}#{i}", item.title)
|
253
|
-
assert_equal("#{link}#{i}", item.link)
|
254
|
-
assert_equal("#{description}#{i}", item.description)
|
255
|
-
|
256
|
-
@dc_elems.each do |var, value|
|
257
|
-
assert_equal(item.__send__("dc_#{var}"), value)
|
258
|
-
end
|
259
|
-
|
260
|
-
@content_elems.each do |var, value|
|
261
|
-
assert_equal(item.__send__("content_#{var}"), value)
|
262
|
-
end
|
263
|
-
|
264
|
-
assert_equal(@trackback_elems[:ping], item.trackback_ping)
|
265
|
-
assert_equal(@trackback_elems[:about].size, item.trackback_abouts.size)
|
266
|
-
item.trackback_abouts.each_with_index do |about, j|
|
267
|
-
assert_equal(@trackback_elems[:about][j], about.value)
|
268
|
-
end
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
def test_setup_maker_items_sort
|
273
|
-
title = "TITLE"
|
274
|
-
link = "http://hoge.com/"
|
275
|
-
description = "text hoge fuga"
|
276
|
-
|
277
|
-
item_size = 5
|
278
|
-
|
279
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
280
|
-
setup_dummy_channel(maker)
|
281
|
-
|
282
|
-
item_size.times do |i|
|
283
|
-
item = RSS::RDF::Item.new("#{link}#{i}")
|
284
|
-
item.title = "#{title}#{i}"
|
285
|
-
item.link = "#{link}#{i}"
|
286
|
-
item.description = "#{description}#{i}"
|
287
|
-
item.dc_date = Time.now + i * 60
|
288
|
-
item.setup_maker(maker.items)
|
289
|
-
end
|
290
|
-
maker.items.do_sort = false
|
291
|
-
end
|
292
|
-
assert_equal(item_size, rss.items.size)
|
293
|
-
rss.items.each_with_index do |item, i|
|
294
|
-
assert_equal("#{link}#{i}", item.about)
|
295
|
-
assert_equal("#{title}#{i}", item.title)
|
296
|
-
assert_equal("#{link}#{i}", item.link)
|
297
|
-
assert_equal("#{description}#{i}", item.description)
|
298
|
-
end
|
299
|
-
|
300
|
-
|
301
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
302
|
-
setup_dummy_channel(maker)
|
303
|
-
|
304
|
-
item_size.times do |i|
|
305
|
-
item = RSS::RDF::Item.new("#{link}#{i}")
|
306
|
-
item.title = "#{title}#{i}"
|
307
|
-
item.link = "#{link}#{i}"
|
308
|
-
item.description = "#{description}#{i}"
|
309
|
-
item.dc_date = Time.now + i * 60
|
310
|
-
item.setup_maker(maker.items)
|
311
|
-
end
|
312
|
-
maker.items.do_sort = true
|
313
|
-
end
|
314
|
-
assert_equal(item_size, rss.items.size)
|
315
|
-
rss.items.reverse.each_with_index do |item, i|
|
316
|
-
assert_equal("#{link}#{i}", item.about)
|
317
|
-
assert_equal("#{title}#{i}", item.title)
|
318
|
-
assert_equal("#{link}#{i}", item.link)
|
319
|
-
assert_equal("#{description}#{i}", item.description)
|
320
|
-
end
|
321
|
-
end
|
322
|
-
|
323
|
-
def test_setup_maker_items_backward_compatibility
|
324
|
-
test_setup_maker_items(true)
|
325
|
-
end
|
326
|
-
|
327
|
-
def test_setup_maker
|
328
|
-
encoding = "EUC-JP"
|
329
|
-
standalone = true
|
330
|
-
|
331
|
-
href = 'a.xsl'
|
332
|
-
type = 'text/xsl'
|
333
|
-
title = 'sample'
|
334
|
-
media = 'printer'
|
335
|
-
charset = 'UTF-8'
|
336
|
-
alternate = 'yes'
|
337
|
-
|
338
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
339
|
-
maker.encoding = encoding
|
340
|
-
maker.standalone = standalone
|
341
|
-
|
342
|
-
maker.xml_stylesheets.new_xml_stylesheet do |xss|
|
343
|
-
xss.href = href
|
344
|
-
xss.type = type
|
345
|
-
xss.title = title
|
346
|
-
xss.media = media
|
347
|
-
xss.charset = charset
|
348
|
-
xss.alternate = alternate
|
349
|
-
end
|
350
|
-
|
351
|
-
setup_dummy_channel(maker)
|
352
|
-
setup_dummy_item(maker)
|
353
|
-
end
|
354
|
-
|
355
|
-
new_rss = RSS::Maker.make("1.0") do |maker|
|
356
|
-
rss.setup_maker(maker)
|
357
|
-
end
|
358
|
-
|
359
|
-
assert_equal("1.0", new_rss.rss_version)
|
360
|
-
assert_equal(encoding, new_rss.encoding)
|
361
|
-
assert_equal(standalone, new_rss.standalone)
|
362
|
-
|
363
|
-
xss = new_rss.xml_stylesheets.first
|
364
|
-
assert_equal(1, new_rss.xml_stylesheets.size)
|
365
|
-
assert_equal(href, xss.href)
|
366
|
-
assert_equal(type, xss.type)
|
367
|
-
assert_equal(title, xss.title)
|
368
|
-
assert_equal(media, xss.media)
|
369
|
-
assert_equal(charset, xss.charset)
|
370
|
-
assert_equal(alternate, xss.alternate)
|
371
|
-
end
|
372
|
-
|
373
|
-
def test_setup_maker_full
|
374
|
-
encoding = "EUC-JP"
|
375
|
-
standalone = true
|
376
|
-
|
377
|
-
href = 'a.xsl'
|
378
|
-
type = 'text/xsl'
|
379
|
-
title = 'sample'
|
380
|
-
media = 'printer'
|
381
|
-
charset = 'UTF-8'
|
382
|
-
alternate = 'yes'
|
383
|
-
|
384
|
-
channel_about = "http://hoge.com"
|
385
|
-
channel_title = "fugafuga"
|
386
|
-
channel_link = "http://hoge.com"
|
387
|
-
channel_description = "fugafugafugafuga"
|
388
|
-
|
389
|
-
image_title = "fugafuga"
|
390
|
-
image_url = "http://hoge.com/hoge.png"
|
391
|
-
|
392
|
-
textinput_title = "fugafuga"
|
393
|
-
textinput_description = "text hoge fuga"
|
394
|
-
textinput_name = "hoge"
|
395
|
-
textinput_link = "http://hoge.com"
|
396
|
-
|
397
|
-
item_title = "TITLE"
|
398
|
-
item_link = "http://hoge.com/"
|
399
|
-
item_description = "text hoge fuga"
|
400
|
-
|
401
|
-
item_size = 5
|
402
|
-
|
403
|
-
rss = RSS::Maker.make("1.0") do |maker|
|
404
|
-
maker.encoding = encoding
|
405
|
-
maker.standalone = standalone
|
406
|
-
|
407
|
-
maker.xml_stylesheets.new_xml_stylesheet do |xss|
|
408
|
-
xss.href = href
|
409
|
-
xss.type = type
|
410
|
-
xss.title = title
|
411
|
-
xss.media = media
|
412
|
-
xss.charset = charset
|
413
|
-
xss.alternate = alternate
|
414
|
-
end
|
415
|
-
|
416
|
-
maker.channel.about = channel_about
|
417
|
-
maker.channel.title = channel_title
|
418
|
-
maker.channel.link = channel_link
|
419
|
-
maker.channel.description = channel_description
|
420
|
-
@dc_elems.each do |var, value|
|
421
|
-
maker.channel.__send__("dc_#{var}=", value)
|
422
|
-
end
|
423
|
-
@sy_elems.each do |var, value|
|
424
|
-
maker.channel.__send__("sy_#{var}=", value)
|
425
|
-
end
|
426
|
-
|
427
|
-
maker.image.title = image_title
|
428
|
-
maker.image.url = image_url
|
429
|
-
@dc_elems.each do |var, value|
|
430
|
-
maker.image.__send__("dc_#{var}=", value)
|
431
|
-
end
|
432
|
-
|
433
|
-
maker.textinput.link = textinput_link
|
434
|
-
maker.textinput.title = textinput_title
|
435
|
-
maker.textinput.description = textinput_description
|
436
|
-
maker.textinput.name = textinput_name
|
437
|
-
@dc_elems.each do |var, value|
|
438
|
-
maker.textinput.__send__("dc_#{var}=", value)
|
439
|
-
end
|
440
|
-
|
441
|
-
item_size.times do |i|
|
442
|
-
maker.items.new_item do |item|
|
443
|
-
item.title = "#{item_title}#{i}"
|
444
|
-
item.link = "#{item_link}#{i}"
|
445
|
-
item.description = "#{item_description}#{i}"
|
446
|
-
|
447
|
-
@dc_elems.each do |var, value|
|
448
|
-
item.__send__("dc_#{var}=", value)
|
449
|
-
end
|
450
|
-
|
451
|
-
@content_elems.each do |var, value|
|
452
|
-
item.__send__("content_#{var}=", value)
|
453
|
-
end
|
454
|
-
|
455
|
-
item.trackback_ping = @trackback_elems[:ping]
|
456
|
-
@trackback_elems[:about].each do |value|
|
457
|
-
item.trackback_abouts.new_about do |new_about|
|
458
|
-
new_about.value = value
|
459
|
-
end
|
460
|
-
end
|
461
|
-
end
|
462
|
-
end
|
463
|
-
|
464
|
-
setup_taxo_topic(maker, @taxo_topic_elems)
|
465
|
-
end
|
466
|
-
|
467
|
-
new_rss = RSS::Maker.make("1.0") do |maker|
|
468
|
-
rss.setup_maker(maker)
|
469
|
-
end
|
470
|
-
|
471
|
-
assert_equal("1.0", new_rss.rss_version)
|
472
|
-
assert_equal(encoding, new_rss.encoding)
|
473
|
-
assert_equal(standalone, new_rss.standalone)
|
474
|
-
|
475
|
-
xss = new_rss.xml_stylesheets.first
|
476
|
-
assert_equal(1, new_rss.xml_stylesheets.size)
|
477
|
-
assert_equal(href, xss.href)
|
478
|
-
assert_equal(type, xss.type)
|
479
|
-
assert_equal(title, xss.title)
|
480
|
-
assert_equal(media, xss.media)
|
481
|
-
assert_equal(charset, xss.charset)
|
482
|
-
assert_equal(alternate, xss.alternate)
|
483
|
-
|
484
|
-
channel = new_rss.channel
|
485
|
-
assert_equal(channel_about, channel.about)
|
486
|
-
assert_equal(channel_title, channel.title)
|
487
|
-
assert_equal(channel_link, channel.link)
|
488
|
-
assert_equal(channel_description, channel.description)
|
489
|
-
item_resources = []
|
490
|
-
item_size.times do |i|
|
491
|
-
item_resources << "#{item_link}#{i}"
|
492
|
-
end
|
493
|
-
assert_equal(item_resources, channel.items.resources)
|
494
|
-
assert_equal(image_url, channel.image.resource)
|
495
|
-
assert_equal(textinput_link, channel.textinput.resource)
|
496
|
-
@dc_elems.each do |var, value|
|
497
|
-
assert_equal(value, channel.__send__("dc_#{var}"))
|
498
|
-
end
|
499
|
-
@sy_elems.each do |var, value|
|
500
|
-
value = value.to_i if var == :updateFrequency
|
501
|
-
assert_equal(value, channel.__send__("sy_#{var}"))
|
502
|
-
end
|
503
|
-
|
504
|
-
image = new_rss.image
|
505
|
-
assert_equal(image_url, image.about)
|
506
|
-
assert_equal(image_url, new_rss.channel.image.resource)
|
507
|
-
assert_equal(image_title, image.title)
|
508
|
-
assert_equal(channel_link, image.link)
|
509
|
-
assert_equal(image_url, image.url)
|
510
|
-
@dc_elems.each do |var, value|
|
511
|
-
assert_equal(image.__send__("dc_#{var}"), value)
|
512
|
-
end
|
513
|
-
|
514
|
-
textinput = new_rss.textinput
|
515
|
-
assert_equal(textinput_link, textinput.about)
|
516
|
-
assert_equal(textinput_link, new_rss.channel.textinput.resource)
|
517
|
-
assert_equal(textinput_title, textinput.title)
|
518
|
-
assert_equal(textinput_name, textinput.name)
|
519
|
-
assert_equal(textinput_description, textinput.description)
|
520
|
-
assert_equal(textinput_link, textinput.link)
|
521
|
-
@dc_elems.each do |var, value|
|
522
|
-
assert_equal(textinput.__send__("dc_#{var}"), value)
|
523
|
-
end
|
524
|
-
|
525
|
-
assert_equal(item_size, new_rss.items.size)
|
526
|
-
new_rss.items.each_with_index do |item, i|
|
527
|
-
assert_equal("#{item_link}#{i}", item.about)
|
528
|
-
assert_equal("#{item_title}#{i}", item.title)
|
529
|
-
assert_equal("#{item_link}#{i}", item.link)
|
530
|
-
assert_equal("#{item_description}#{i}", item.description)
|
531
|
-
|
532
|
-
@dc_elems.each do |var, value|
|
533
|
-
assert_equal(item.__send__("dc_#{var}"), value)
|
534
|
-
end
|
535
|
-
|
536
|
-
@content_elems.each do |var, value|
|
537
|
-
assert_equal(item.__send__("content_#{var}"), value)
|
538
|
-
end
|
539
|
-
|
540
|
-
assert_equal(@trackback_elems[:ping], item.trackback_ping)
|
541
|
-
assert_equal(@trackback_elems[:about].size, item.trackback_abouts.size)
|
542
|
-
item.trackback_abouts.each_with_index do |about, j|
|
543
|
-
assert_equal(@trackback_elems[:about][j], about.value)
|
544
|
-
end
|
545
|
-
end
|
546
|
-
|
547
|
-
assert_taxo_topic(@taxo_topic_elems, new_rss)
|
548
|
-
end
|
549
|
-
|
550
|
-
end
|
551
|
-
end
|