Commit | Line | Data |
390f59b3 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
c7ded7aa |
5 | |
6 | my @tests = ( |
7 | { |
8 | given => [ { a => 1 }, { b => 1 } ], |
9 | expects => { a => 1, b => 1 } |
10 | }, |
11 | { |
12 | given => [ { a => 1 }, { a => { b => 1 } } ], |
13 | expects => { a => { b => 1 } } |
14 | }, |
15 | { |
16 | given => [ { a => { b => 1 } }, { a => 1 } ], |
17 | expects => { a => 1 } |
18 | }, |
19 | { |
20 | given => [ { a => 1 }, { a => [ 1 ] } ], |
21 | expects => { a => [ 1 ] } |
22 | }, |
23 | { |
24 | given => [ { a => [ 1 ] }, { a => 1 } ], |
25 | expects => { a => 1 } |
26 | }, |
27 | { |
28 | given => [ { a => { b => 1 } }, { a => { b => 2 } } ], |
29 | expects => { a => { b => 2 } } |
30 | }, |
31 | { |
32 | given => [ { a => { b => 1 } }, { a => { c => 1 } } ], |
33 | expects => { a => { b => 1, c => 1 } } |
34 | }, |
35 | ); |
390f59b3 |
36 | |
5d50f369 |
37 | plan tests => scalar @tests; |
390f59b3 |
38 | |
5d50f369 |
39 | use Catalyst::Component; |
390f59b3 |
40 | |
c7ded7aa |
41 | for my $test ( @ tests ) { |
5d50f369 |
42 | is_deeply( Catalyst::Component->merge_config_hashes( @{ $test->{ given } } ), $test->{ expects } ); |
c7ded7aa |
43 | } |