/[Frey]/trunk/t/01-frey-config.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

Contents of /trunk/t/01-frey-config.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations)
Wed Nov 26 07:57:12 2008 UTC (15 years, 4 months ago) by dpavlin
File MIME type: application/x-troff
File size: 920 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 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 use Test::More tests => 13;
6 use lib 'lib';
7
8 use Data::Dump qw/dump/;
9
10 my $debug = @ARGV ? 1 : 0;
11
12 BEGIN {
13 use_ok('Frey::Config');
14 use_ok('Frey');
15 }
16
17 {
18 package Test::Mock;
19 use Moose;
20 extends 'Frey';
21 with 'Frey::Config';
22 }
23
24 isa_ok( Frey::Config->meta, 'Moose::Meta::Role' );
25
26 ok( my $o = Test::Mock->new( debug => $debug ), 'new' );
27 diag $o->dump(2) if $debug;
28
29 ok( my $config = $o->config, 'config' );
30
31 diag dump($config) if $debug;
32
33 ok( $o->config->{test}, 'test' );
34 ok( $o->config->{config}, 'config' );
35 is( $o->config->{numeric}, 42, 'numeric' );
36
37 ok( my $whole = $o->config('Test::Mock'), 'explicit package' );
38 diag dump($whole) if $debug;
39
40 cmp_ok( $o->config->{test}, 'eq', $o->config('Test::Mock')->{test}, 'text' );
41
42 ok( ! $o->config('non-existenting'), 'non-existing' );
43
44 ok( ! $o->load_config, 'load_config' );
45 is_deeply( $o->config, $config, 'not duplicated' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26