source: trunk/t/16_test_tester.t @ 956

Last change on this file since 956 was 956, checked in by Earle Martin, 15 years 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
File size: 1.4 KB
Line 
1use strict;
2use Wiki::Toolkit::Setup::SQLite;
3use OpenGuides;
4use OpenGuides::Test;
5use Test::More;
6
7eval { require DBD::SQLite; };
8if ( $@ ) {
9    my ($error) = $@ =~ /^(.*?)\n/;
10    plan skip_all => "DBD::SQLite could not be used - no database to test with. ($error)";
11}
12
13eval { require Plucene; };
14if ( $@ ) {
15    plan skip_all => "Plucene not installed";
16}
17
18plan tests => 2;
19
20# Clear out the database from any previous runs.
21unlink "t/node.db";
22unlink <t/indexes/*>;
23
24Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
25my $config = OpenGuides::Test->make_basic_config;
26$config->site_name( "Test Site" );
27my $guide = OpenGuides->new( config => $config );
28
29OpenGuides::Test->write_data(
30                              guide      => $guide,
31                              node       => "London Zoo",
32                              content    => "It's a zoo.",
33                            );
34my $wiki = $guide->wiki;
35my %data = $wiki->retrieve_node( "London Zoo" );
36is( $data{content}, "It's a zoo.", "first write with write_data went in" );
37
38OpenGuides::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" );
44is( $data{content}, "It's still a zoo.", "...so does second" );
45
Note: See TracBrowser for help on using the repository browser.