~ubuntu-branches/ubuntu/vivid/libwiki-toolkit-formatter-usemod-perl/vivid

« back to all changes in this revision

Viewing changes to t/encode-node-names.t

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves
  • Date: 2006-10-20 11:36:52 UTC
  • Revision ID: james.westby@ubuntu.com-20061020113652-9rs9i0ii0if52qff
Tags: upstream-0.20
ImportĀ upstreamĀ versionĀ 0.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
use Wiki::Toolkit::Formatter::UseMod;
 
3
use Test::More tests => 4;
 
4
 
 
5
my $formatter = Wiki::Toolkit::Formatter::UseMod->new( munge_urls => 1 );
 
6
is( $formatter->node_name_to_node_param( "test page" ),
 
7
    "Test_Page", "->node_name_to_node_param forces ucfirst by default" );
 
8
 
 
9
$formatter = Wiki::Toolkit::Formatter::UseMod->new( force_ucfirst_nodes => 0,
 
10
                                                munge_urls          => 1 );
 
11
is( $formatter->node_name_to_node_param( "test page" ),
 
12
    "test_page", "...but not if force_ucfirst_nodes set to 0" );
 
13
 
 
14
$formatter = Wiki::Toolkit::Formatter::UseMod->new;
 
15
is( $formatter->node_name_to_node_param( "Home Page" ), "Home Page",
 
16
    "->node_name_to_node_param does nothing if munge_urls not true" );
 
17
is( $formatter->node_param_to_node_name( "Home_Page" ), "Home_Page",
 
18
    "->node_param_to_node_name does nothing if munge_urls not true" );
 
19