Changeset 361 for trunk/t/15_template.t
- Timestamp:
- 06/07/04 21:39:35 (5 years ago)
- Files:
-
- 1 modified
-
trunk/t/15_template.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/t/15_template.t
r311 r361 1 1 use strict; 2 use Test::More tests => 28;3 2 use Config::Tiny; 4 3 use Cwd; 5 4 use CGI::Cookie; 6 5 use CGI::Wiki::Formatter::UseMod; 6 use OpenGuides::Template; 7 7 use Test::MockObject; 8 9 use_ok( "OpenGuides::Template" ); 10 11 my $config = Config::Tiny->read( "t/21_wiki.conf" ); 12 $config->{_}->{template_path} = cwd . "/t/templates"; 8 use Test::More tests => 27; 9 10 my $config = Config::Tiny->new; 11 $config->{_} = { 12 template_path => cwd . '/t/templates', 13 site_name => 'CGI::Wiki Test Site', 14 script_url => 'http://wiki.example.com/', 15 script_name => 'mywiki.cgi', 16 default_country => 'United Kingdom', 17 default_city => 'London', 18 contact_email => 'wiki@example.com', 19 stylesheet_url => 'http://wiki.example.com/styles.css', 20 home_name => 'Home Page', 21 formatting_rules_node => 'Rules', 22 }; 13 23 14 24 # White box testing - we know that OpenGuides::Template only actually uses 15 25 # the node_name_to_node_param method of the formatter component of the wiki 16 # object passed in, and I CBA to faff about with picking out the test DB 17 # info to make a proper wiki object here. 26 # object passed in, and I CBA to make a proper wiki object here. 18 27 my $fake_wiki = Test::MockObject->new; 19 28 $fake_wiki->mock("formatter", … … 103 112 104 113 # Test that home_link is set correctly when script_name is blank. 105 $config = Config::Tiny->read( "t/15_wiki.conf" ); 106 $config->{_}->{template_path} = cwd . "/t/templates"; 114 $config->{_} = { 115 template_path => cwd . '/t/templates', 116 site_name => 'CGI::Wiki Test Site', 117 script_url => 'http://wiki.example.com/', 118 script_name => '', 119 }; 107 120 $output = OpenGuides::Template->output( 108 121 wiki => $fake_wiki, … … 115 128 # Test that full_cgi_url comes out right if the trailing '/' is 116 129 # missing from script_url in the config file. 117 $config = Config::Tiny->read( "t/15_wiki.conf" ); 118 $config->{_}->{template_path} = cwd . "/t/templates"; 119 $config->{_}->{script_url} = "http://wiki.example.com"; 120 $config->{_}->{script_name} = "wiki.cgi"; 130 $config->{_} = { 131 template_path => cwd . '/t/templates', 132 site_name => 'CGI::Wiki Test Site', 133 script_url => 'http://wiki.example.com', 134 script_name => 'wiki.cgi', 135 }; 121 136 $output = OpenGuides::Template->output( 122 137 wiki => $fake_wiki,
