Last change
on this file since 261 was
261,
checked in by Dominic Hargreaves, 15 years ago
|
More renames.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
975 bytes
|
Line | |
---|
1 | use strict; |
---|
2 | use Wiki::Toolkit::Plugin::Categoriser; |
---|
3 | use Wiki::Toolkit::TestLib; |
---|
4 | use Test::More; |
---|
5 | |
---|
6 | my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker; |
---|
7 | plan tests => ( $iterator->number * 1 ); |
---|
8 | |
---|
9 | while ( my $wiki = $iterator->new_wiki ) { |
---|
10 | print "#\n##### TEST CONFIG: Store: " . (ref $wiki->store) . "\n"; |
---|
11 | |
---|
12 | my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new; |
---|
13 | $wiki->register_plugin( plugin => $categoriser ); |
---|
14 | |
---|
15 | $wiki->write_node( "Pub Food", "pubs that serve food", undef, |
---|
16 | { category => [ "Pubs", "Food", "Category" ] } ) |
---|
17 | or die "Can't write node"; |
---|
18 | |
---|
19 | $wiki->write_node( "Restaurants", "places that serve food", undef, |
---|
20 | { category => [ "Food", "Category" ] } ) |
---|
21 | or die "Can't write node"; |
---|
22 | |
---|
23 | my @subcategories = $categoriser->subcategories( category => "Pubs" ); |
---|
24 | is_deeply( \@subcategories, [ "Pub Food" ], |
---|
25 | "->subcategories returns things that belong, and not things that don't" ); |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.