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

Last change on this file since 567 was 567, checked in by kake, 17 years ago

Make sure second write works.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1use strict;
2use CGI::Wiki::Setup::SQLite;
3use OpenGuides;
4use OpenGuides::Test;
5use Test::More;
6
7eval { require DBD::SQLite; };
8if ( $@ ) {
9    plan skip_all => "DBD::SQLite not installed";
10}
11
12eval { require Plucene; };
13if ( $@ ) {
14    plan skip_all => "Plucene not installed";
15}
16
17plan tests => 2;
18
19# Clear out the database from any previous runs.
20unlink "t/node.db";
21unlink <t/indexes/*>;
22
23CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
24my $config = OpenGuides::Test->make_basic_config;
25$config->{_}{site_name} = "Test Site";
26my $guide = OpenGuides->new( config => $config );
27
28OpenGuides::Test->write_data(
29                              guide      => $guide,
30                              node       => "London Zoo",
31                              content    => "It's a zoo.",
32                            );
33my $wiki = $guide->wiki;
34my %data = $wiki->retrieve_node( "London Zoo" );
35is( $data{content}, "It's a zoo.", "first write with write_data went in" );
36
37OpenGuides::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" );
43is( $data{content}, "It's still a zoo.", "...so does second" );
44
Note: See TracBrowser for help on using the repository browser.