Ignore:
Timestamp:
Mar 20, 2007, 4:47:05 PM (15 years ago)
Author:
Earle Martin
Message:

Complete transition to using skip_all (remove old SKIP blocks).
More verbose reporting for error "require"ing DBD::SQLite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/65_bug_metadata_escape.t

    r785 r956  
    77eval { require DBD::SQLite; };
    88if ( $@ ) {
    9     plan skip_all => "DBD:SQLite not installed";
    10 } else {
    11     plan tests => 1;
    12 
    13     Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
    14     Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    15     my $config = OpenGuides::Config->new(
    16            vars => {
    17                      dbtype             => "sqlite",
    18                      dbname             => "t/node.db",
    19                      indexing_directory => "t/indexes",
    20                      script_url         => "http://wiki.example.com/",
    21                      script_name        => "mywiki.cgi",
    22                      site_name          => "Wiki::Toolkit Test Site",
    23                      template_path      => cwd . "/templates",
    24                    }
    25     );
    26     eval { require Wiki::Toolkit::Search::Plucene; };
    27     if ( $@ ) { $config->use_plucene ( 0 ) };
    28 
    29     my $guide = OpenGuides->new( config => $config );
    30 
    31     $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { phone => "<hr><h1>hello mum</h1><hr>" } ) or die "Can't write node";
    32 
    33     my $output = $guide->display_node(
    34                                        id => "South Croydon Station",
    35                                        return_output => 1,
    36                                      );
    37     unlike( $output, qr'<hr><h1>hello mum</h1><hr>',
    38             "HTML escaped in metadata on node display" );
     9    my ($error) = $@ =~ /^(.*?)\n/;
     10    plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)";
    3911}
    4012
     13plan tests => 1;
     14
     15Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
     16Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
     17my $config = OpenGuides::Config->new(
     18       vars => {
     19                 dbtype             => "sqlite",
     20                 dbname             => "t/node.db",
     21                 indexing_directory => "t/indexes",
     22                 script_url         => "http://wiki.example.com/",
     23                 script_name        => "mywiki.cgi",
     24                 site_name          => "Wiki::Toolkit Test Site",
     25                 template_path      => cwd . "/templates",
     26               }
     27);
     28eval { require Wiki::Toolkit::Search::Plucene; };
     29if ( $@ ) { $config->use_plucene ( 0 ) };
     30
     31my $guide = OpenGuides->new( config => $config );
     32
     33$guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { phone => "<hr><h1>hello mum</h1><hr>" } ) or die "Can't write node";
     34
     35my $output = $guide->display_node(
     36                                   id => "South Croydon Station",
     37                                   return_output => 1,
     38                                 );
     39unlike( $output, qr'<hr><h1>hello mum</h1><hr>',
     40        "HTML escaped in metadata on node display" );
Note: See TracChangeset for help on using the changeset viewer.