|
Revision 956, 1.4 kB
(checked in by earle, 22 months ago)
|
|
Complete transition to using skip_all (remove old SKIP blocks).
More verbose reporting for error "require"ing DBD::SQLite.
|
-
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 | my ($error) = $@ =~ /^(.*?)\n/; |
|---|
| 10 | plan skip_all => "DBD::SQLite could not be used - no database to test with. ($error)"; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | eval { require Plucene; }; |
|---|
| 14 | if ( $@ ) { |
|---|
| 15 | plan skip_all => "Plucene not installed"; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | plan tests => 2; |
|---|
| 19 | |
|---|
| 20 | # Clear out the database from any previous runs. |
|---|
| 21 | unlink "t/node.db"; |
|---|
| 22 | unlink <t/indexes/*>; |
|---|
| 23 | |
|---|
| 24 | Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } ); |
|---|
| 25 | my $config = OpenGuides::Test->make_basic_config; |
|---|
| 26 | $config->site_name( "Test Site" ); |
|---|
| 27 | my $guide = OpenGuides->new( config => $config ); |
|---|
| 28 | |
|---|
| 29 | OpenGuides::Test->write_data( |
|---|
| 30 | guide => $guide, |
|---|
| 31 | node => "London Zoo", |
|---|
| 32 | content => "It's a zoo.", |
|---|
| 33 | ); |
|---|
| 34 | my $wiki = $guide->wiki; |
|---|
| 35 | my %data = $wiki->retrieve_node( "London Zoo" ); |
|---|
| 36 | is( $data{content}, "It's a zoo.", "first write with write_data went in" ); |
|---|
| 37 | |
|---|
| 38 | OpenGuides::Test->write_data( |
|---|
| 39 | guide => $guide, |
|---|
| 40 | node => "London Zoo", |
|---|
| 41 | content => "It's still a zoo.", |
|---|
| 42 | ); |
|---|
| 43 | %data = $wiki->retrieve_node( "London Zoo" ); |
|---|
| 44 | is( $data{content}, "It's still a zoo.", "...so does second" ); |
|---|