|
Revision 785, 1.3 kB
(checked in by dom, 3 years ago)
|
|
Use Wiki::Toolkit. Note that CGI::Wiki::Plugin::Diff hasn't been converted yet,
so tests will be broken for now.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use Wiki::Toolkit::Setup::SQLite; |
|---|
| 3 | use OpenGuides; |
|---|
| 4 | use OpenGuides::Test; |
|---|
| 5 | use Test::More; |
|---|
| 6 | |
|---|
| 7 | eval { require DBD::SQLite; }; |
|---|
| 8 | if ( $@ ) { |
|---|
| 9 | plan skip_all => "DBD::SQLite not installed"; |
|---|
| 10 | } |
|---|
| 11 | |
|---|
| 12 | eval { require Plucene; }; |
|---|
| 13 | if ( $@ ) { |
|---|
| 14 | plan skip_all => "Plucene not installed"; |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | plan tests => 2; |
|---|
| 18 | |
|---|
| 19 | # Clear out the database from any previous runs. |
|---|
| 20 | unlink "t/node.db"; |
|---|
| 21 | unlink <t/indexes/*>; |
|---|
| 22 | |
|---|
| 23 | Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } ); |
|---|
| 24 | my $config = OpenGuides::Test->make_basic_config; |
|---|
| 25 | $config->site_name( "Test Site" ); |
|---|
| 26 | my $guide = OpenGuides->new( config => $config ); |
|---|
| 27 | |
|---|
| 28 | OpenGuides::Test->write_data( |
|---|
| 29 | guide => $guide, |
|---|
| 30 | node => "London Zoo", |
|---|
| 31 | content => "It's a zoo.", |
|---|
| 32 | ); |
|---|
| 33 | my $wiki = $guide->wiki; |
|---|
| 34 | my %data = $wiki->retrieve_node( "London Zoo" ); |
|---|
| 35 | is( $data{content}, "It's a zoo.", "first write with write_data went in" ); |
|---|
| 36 | |
|---|
| 37 | OpenGuides::Test->write_data( |
|---|
| 38 | guide => $guide, |
|---|
| 39 | node => "London Zoo", |
|---|
| 40 | content => "It's still a zoo.", |
|---|
| 41 | ); |
|---|
| 42 | %data = $wiki->retrieve_node( "London Zoo" ); |
|---|
| 43 | is( $data{content}, "It's still a zoo.", "...so does second" ); |
|---|