|
Revision 956, 1.0 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.
|
| Line | |
|---|
| 1 | use Wiki::Toolkit::Setup::SQLite; |
|---|
| 2 | use OpenGuides; |
|---|
| 3 | use OpenGuides::Test; |
|---|
| 4 | use Test::More; |
|---|
| 5 | |
|---|
| 6 | eval { require DBD::SQLite; }; |
|---|
| 7 | |
|---|
| 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 | plan tests => 1; |
|---|
| 14 | |
|---|
| 15 | Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } ); |
|---|
| 16 | Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } ); |
|---|
| 17 | my $config = OpenGuides::Test->make_basic_config; |
|---|
| 18 | my $guide = OpenGuides->new( config => $config ); |
|---|
| 19 | |
|---|
| 20 | $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { website => "http://www.example.com/" } ) or die "Couldn't write node"; |
|---|
| 21 | |
|---|
| 22 | my $output = $guide->display_node( |
|---|
| 23 | id => "South Croydon Station", |
|---|
| 24 | return_output => 1, |
|---|
| 25 | ); |
|---|
| 26 | like( $output, qr#Website:</span> <span class="url"><a href="http://www.example.com/">http://www.example.com/</a>#, "website correctly displayed" ); |
|---|