/[Frey]/trunk/t/21-frey-web-links.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/21-frey-web-links.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations)
Wed Nov 26 07:57:12 2008 UTC (15 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 629 byte(s)
refactor Frey::Boostrap from Frey::Server to have correct warn handling

- we now use File::Tee to capture STDERR to file and display that
  (with filtering) for display
- added FREY_NO_LOG enviroment variable to disable logging (for perl -c)
- move all warnings handling into Frey::Web->warnings_html
- make Frey->debug Int (this touched a bunch of tests)
1 dpavlin 110 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5 dpavlin 532 my $debug = @ARGV ? 1 : 0;
6 dpavlin 110
7     use Test::More tests => 7;
8     use lib 'lib';
9    
10     use Data::Dump qw/dump/;
11    
12     BEGIN {
13     use_ok('Frey::Web::Links');
14     use_ok('Strix::User');
15     }
16    
17     ok( my $u = Frey::Web::Links->new(
18     name => 'foo',
19     current => 3,
20     values => [ 1 .. 5 ],
21     delimiter => '!',
22     ), 'new' );
23    
24     diag dump( $u ) if $debug;
25    
26     ok( my $h = $u->links, 'links' );
27     diag $h if $debug;
28    
29     cmp_ok( $h, 'eq',
30     '<a href="?foo=1">1</a>!<a href="?foo=2">2</a>!<em>3</em>!<a href="?foo=4">4</a>!<a href="?foo=5">5</a>'
31     , 'markup' );
32    
33     ok( my @l = $u->links, 'links as array' );
34     cmp_ok( scalar @l, '==', 5, '5 links' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26