From: Chris W. <la...@us...> - 2005-02-08 01:48:31
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30324/t Modified Files: config_package.t Log Message: check the author_names(), author_emails() Index: config_package.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/config_package.t,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** config_package.t 26 Sep 2004 16:06:01 -0000 1.9 --- config_package.t 8 Feb 2005 01:48:21 -0000 1.10 *************** *** 6,10 **** use lib 't/'; require 'utils.pl'; ! use Test::More tests => 26; my $package = 'OITest'; --- 6,10 ---- use lib 't/'; require 'utils.pl'; ! use Test::More tests => 38; my $package = 'OITest'; *************** *** 35,38 **** --- 35,52 ---- is_deeply( $c->author( \@author ), \@author, 'Authors set' ); + my @names = $c->author_names; + is( scalar @names, 2, + 'Number of author names returned' ); + is( $names[0], 'Me', + 'First result from author_names()' ); + is( $names[1], 'You', + 'Second result from author_names()' ); + my @emails = $c->author_emails; + is( scalar @emails, 2, + 'Number of author emails returned' ); + is( $emails[0], 'me...@me...', + 'First result from author_emails()' ); + is( $emails[1], 'yo...@yo...', + 'Second result from author_emails()' ); is_deeply( $c->template_plugin( \%plugin ), \%plugin, 'Plugin set' ); *************** *** 47,50 **** --- 61,84 ---- is( $c->description( $description ), $description, 'Description set' ); + + # check alternate author formattings + $c->author( [ + 'Foo Bar', 'Bar Foo (ba...@fo...)', + ] ); + my @names = $c->author_names; + is( scalar @names, 2, + 'Number of alt author names returned' ); + is( $names[0], 'Foo Bar', + 'First alt result from author_names()' ); + is( $names[1], 'Bar Foo', + 'Second alt result from author_names()' ); + my @emails = $c->author_emails; + is( scalar @emails, 2, + 'Number of author emails returned' ); + is( $emails[0], '', + 'First alt result from author_emails()' ); + is( $emails[1], 'ba...@fo...', + 'Second alt result from author_emails()' ); + my $write_file = get_use_file( 'test-write_package.conf', 'name' ); is( $c->filename( $write_file ), $write_file, |