Changeset 1499

Show
Ignore:
Timestamp:
08/20/06 18:16:38
Author:
miyagawa
Message:

Fixed Subscription::OPML bug that Conainers tag are not properly dereferenced. Added test.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Subscription/OPML.pm

    r1173 r1499  
    6262        $feed->link($outline->{htmlUrl}); 
    6363        $feed->title($outline->{title} || $outline->{text}); 
    64         $feed->tags($containers); 
     64        $feed->tags([ @$containers ]); 
    6565        $context->subscription->add($feed); 
    6666    } 
  • trunk/plagger/t/plugins/Subscription-OPML/subscription.t

    r1420 r1499  
    33 
    44test_plugin_deps; 
    5 plan tests => 3
     5plan 'no_plan'
    66 
    77diag "This test will raise warnings due to XML::OPML internal, but it's harmless"; 
     
    2121is $context->subscription->feeds->[0]->link, "http://blog.bulknews.net/mt/"; 
    2222is $context->subscription->feeds->[0]->title, "blog.bulknews.net"; 
     23 
     24=== test nested subs 
     25--- input config 
     26plugins: 
     27  - module: Subscription::OPML 
     28    config: 
     29      url: file://$t::TestPlagger::BaseDirURI/t/samples/opml-nested.xml 
     30  - module: Aggregator::Null 
     31--- expected 
     32my @feeds = sort { $a->url cmp $b->url } $context->subscription->feeds; 
     33 
     34is $feeds[0]->url, "http://blog.bulknews.net/mt/index.rdf"; 
     35is $feeds[0]->link, "http://blog.bulknews.net/mt/"; 
     36is $feeds[0]->title, "blog.bulknews.net"; 
     37is_deeply $feeds[0]->tags, [ 'Foo' ]; 
     38 
     39is $feeds[1]->url, "http://subtech.g.hatena.ne.jp/miyagawa/rss"; 
     40is $feeds[1]->link, "http://subtech.g.hatena.ne.jp/miyagawa/"; 
     41is $feeds[1]->title, "Bulknews::Subtech"; 
     42is_deeply $feeds[1]->tags, [ 'Bar', 'Baz' ]; 
     43