/[Frey]/branches/dbic/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

Annotation of /branches/dbic/t/01-frey-config.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 438 - (hide annotations)
Wed Nov 19 01:32:36 2008 UTC (15 years, 5 months ago) by dpavlin
Original Path: trunk/t/01-frey-config.t
File MIME type: application/x-troff
File size: 917 byte(s)
test load_config duplication, fix typo
1 dpavlin 219 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5 dpavlin 438 use Test::More tests => 13;
6 dpavlin 219 use lib 'lib';
7    
8     use Data::Dump qw/dump/;
9    
10     my $debug = 1 if @ARGV;
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 dpavlin 221
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 dpavlin 229 ok( ! $o->config('non-existenting'), 'non-existing' );
43 dpavlin 438
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