435
434
new_about.value = about
439
def assert_channel10(attrs, channel)
441
n_attrs = normalized_attrs(attrs)
443
names = %w(about title link description)
444
assert_attributes(attrs, names, channel)
446
%w(image items textinput).each do |name|
447
value = n_attrs[name]
449
target = channel.__send__(name)
450
__send__("assert_channel10_#{name}", value, target)
456
def assert_channel10_image(attrs, image)
458
assert_attributes(attrs, %w(resource), image)
462
def assert_channel10_textinput(attrs, textinput)
464
assert_attributes(attrs, %w(resource), textinput)
468
def assert_channel10_items(attrs, items)
470
assert_equal(items.resources, items.Seq.lis.collect {|x| x.resource})
471
items.Seq.lis.each_with_index do |li, i|
472
assert_attributes(attrs[i], %w(resource), li)
477
def assert_image10(attrs, image)
479
names = %w(about title url link)
480
assert_attributes(attrs, names, image)
484
def assert_items10(attrs, items)
486
names = %w(about title link description)
487
items.each_with_index do |item, i|
488
assert_attributes(attrs[i], names, item)
493
def assert_textinput10(attrs, textinput)
495
names = %w(about title description name link)
496
assert_attributes(attrs, names, textinput)
501
def assert_channel09(attrs, channel)
503
n_attrs = normalized_attrs(attrs)
505
names = %w(title description link language rating
506
copyright pubDate lastBuildDate docs
507
managingEditor webMaster)
508
assert_attributes(attrs, names, channel)
510
%w(skipHours skipDays).each do |name|
511
value = n_attrs[name]
513
target = channel.__send__(name)
514
__send__("assert_channel09_#{name}", value, target)
520
def assert_channel09_skipDays(contents, skipDays)
523
contents.each_with_index do |content, i|
524
assert_equal(content, days[i].content)
529
def assert_channel09_skipHours(contents, skipHours)
531
hours = skipHours.hours
532
contents.each_with_index do |content, i|
533
assert_equal(content.to_i, hours[i].content)
538
def assert_image09(attrs, image)
540
names = %w(url link title description)
541
names << ["width", :integer]
542
names << ["height", :integer]
543
assert_attributes(attrs, names, image)
547
def assert_items09(attrs, items)
549
names = %w(title link description)
550
items.each_with_index do |item, i|
551
assert_attributes(attrs[i], names, item)
556
def assert_textinput09(attrs, textinput)
558
names = %w(title description name link)
559
assert_attributes(attrs, names, textinput)
564
def assert_channel20(attrs, channel)
566
n_attrs = normalized_attrs(attrs)
568
names = %w(title link description language copyright
569
managingEditor webMaster pubDate
570
lastBuildDate generator docs rating)
571
names << ["ttl", :integer]
572
assert_attributes(attrs, names, channel)
574
%w(cloud categories skipHours skipDays).each do |name|
575
value = n_attrs[name]
577
target = channel.__send__(name)
578
__send__("assert_channel20_#{name}", value, target)
584
def assert_channel20_skipDays(contents, skipDays)
585
assert_channel09_skipDays(contents, skipDays)
588
def assert_channel20_skipHours(contents, skipHours)
589
assert_channel09_skipHours(contents, skipHours)
592
def assert_channel20_cloud(attrs, cloud)
594
names = %w(domain path registerProcedure protocol)
595
names << ["port", :integer]
596
assert_attributes(attrs, names, cloud)
600
def assert_channel20_categories(attrs, categories)
602
names = %w(domain content)
603
categories.each_with_index do |category, i|
604
assert_attributes(attrs[i], names, category)
609
def assert_image20(attrs, image)
611
names = %w(url link title description)
612
names << ["width", :integer]
613
names << ["height", :integer]
614
assert_attributes(attrs, names, image)
618
def assert_items20(attrs, items)
620
names = %w(about title link description)
621
items.each_with_index do |item, i|
622
assert_attributes(attrs[i], names, item)
624
n_attrs = normalized_attrs(attrs[i])
626
%w(source enclosure categories guid).each do |name|
627
value = n_attrs[name]
629
target = item.__send__(name)
630
__send__("assert_items20_#{name}", value, target)
637
def assert_items20_source(attrs, source)
639
assert_attributes(attrs, %w(url content), source)
643
def assert_items20_enclosure(attrs, enclosure)
645
names = ["url", ["length", :integer], "type"]
646
assert_attributes(attrs, names, enclosure)
650
def assert_items20_categories(attrs, categories)
652
assert_channel20_categories(attrs, categories)
656
def assert_items20_guid(attrs, guid)
658
names = [["isPermaLink", :boolean], ["content"]]
659
assert_attributes(attrs, names, guid)
663
def assert_textinput20(attrs, textinput)
665
names = %w(title description name link)
666
assert_attributes(attrs, names, textinput)