source: trunk/t/62_bug_trailing_whitespace.t @ 589

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

Rename t/62_bug_os_coords.t to t/62_bug_trailing_whitespace.t, use OpenGuides::Test instead of making our own config object.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1use CGI::Wiki::Setup::SQLite;
2use OpenGuides::Config;
3use OpenGuides::Template;
4use OpenGuides::Test;
5use OpenGuides::Utils;
6use Test::More tests => 2;
7
8eval { require DBD::SQLite; };
9my $have_sqlite = $@ ? 0 : 1;
10
11SKIP: {
12    skip "DBD::SQLite not installed - no database to test with", 2
13      unless $have_sqlite;
14
15    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
16    my $config = OpenGuides::Test->make_basic_config;
17    my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
18
19    my $q = CGI->new;
20    $q->param( -name => "os_x", -value => "123456 " );
21    $q->param( -name => "os_y", -value => "654321 " );
22    $q->param( -name => "categories", -value => "" ); #avoid uninit val warning
23    $q->param( -name => "locales", -value => "" );    #avoid uninit val warning
24
25    my %metadata_vars = OpenGuides::Template->extract_metadata_vars(
26        wiki    => $wiki,
27        config  => $config,
28        cgi_obj => $q,
29    );
30
31    is( $metadata_vars{os_x}, "123456", "trailing space stripped from os_x" );
32    is( $metadata_vars{os_y}, "654321", "trailing space stripped from os_y" );
33}
Note: See TracBrowser for help on using the repository browser.