root/branches/new-install-process/t/64_bug_node_history.t

Revision 956, 1.7 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 
1use Wiki::Toolkit::Setup::SQLite;
2use OpenGuides::Config;
3use Cwd;
4use OpenGuides;
5use Test::More;
6
7eval { require DBD::SQLite; };
8
9if ( $@ ) {
10    my ($error) = $@ =~ /^(.*?)\n/;
11    plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)";
12}
13
14plan tests => 1;
15
16Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
17Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
18my $config = OpenGuides::Config->new(
19       vars => {
20                 dbtype             => "sqlite",
21                 dbname             => "t/node.db",
22                 indexing_directory => "t/indexes",
23                 script_url         => "http://wiki.example.com/",
24                 script_name        => "mywiki.cgi",
25                 site_name          => "Wiki::Toolkit Test Site",
26                 template_path      => cwd . "/templates",
27               }
28);
29eval { require Wiki::Toolkit::Search::Plucene; };
30if ( $@ ) { $config->use_plucene ( 0 ) };
31
32my $guide = OpenGuides->new( config => $config );
33
34$guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { comment => "<myfaketag>" } ) or die "Can't write node";
35my %data = $guide->wiki->retrieve_node( "South Croydon Station" );
36$guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", $data{checksum}, { comment => "<myfaketag>" } ) or die "Can't write node";
37
38my $output = $guide->list_all_versions(
39                                        id => "South Croydon Station",
40                                        return_output => 1,
41                                      );
42unlike( $output, qr'<myfaketag>', "HTML escaped in comments" );
Note: See TracBrowser for help on using the browser.