Changeset 361 for trunk/t/61_bug_textareas.t
- Timestamp:
- 06/07/04 21:39:35 (5 years ago)
- Files:
-
- 1 modified
-
trunk/t/61_bug_textareas.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/t/61_bug_textareas.t
r230 r361 1 use strict;1 use CGI::Wiki::Setup::SQLite; 2 2 use Config::Tiny; 3 3 use Cwd; … … 6 6 use Test::More tests => 1; 7 7 8 ##### 9 ##### IMPORTANT: Treat this wiki object as read-only or we may eat live data. 10 ##### 8 eval { require DBD::SQLite; }; 9 my $have_sqlite = $@ ? 0 : 1; 11 10 12 my $config = Config::Tiny->read( "wiki.conf" ) 13 or die "Couldn't read wiki.conf"; 14 my $wiki = OpenGuides::Utils->make_wiki_object( config => $config ); 15 $config->{_}{template_path} = cwd . "/templates"; 11 SKIP: { 12 skip "DBD::SQLite not installed - no database to test with", 1 13 unless $have_sqlite; 16 14 17 my $out = OpenGuides::Template->output( 18 wiki => $wiki,19 config => $config,20 template => "edit_form.tt",21 vars => {22 locales => [23 { name => "Barville" },24 { name => "Fooville" },25 ],26 },27 );15 CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } ); 16 my $config = Config::Tiny->new; 17 $config->{_} = { 18 dbtype => "sqlite", 19 dbname => "t/node.db", 20 indexing_directory => "t/indexes", 21 script_url => "http://wiki.example.com/", 22 script_name => "mywiki.cgi", 23 site_name => "CGI::Wiki Test Site", 24 template_path => cwd . "/templates", 25 }; 28 26 29 like( $out, qr/Barville\nFooville/, "locales properly separated in textarea" ); 27 my $wiki = OpenGuides::Utils->make_wiki_object( config => $config ); 28 29 my $out = OpenGuides::Template->output( 30 wiki => $wiki, 31 config => $config, 32 template => "edit_form.tt", 33 vars => { 34 locales => [ 35 { name => "Barville" }, 36 { name => "Fooville" }, 37 ], 38 }, 39 ); 40 41 like( $out, qr/Barville\nFooville/, 42 "locales properly separated in textarea" ); 43 } 30 44 31 45
