| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use Test::More tests => 7; |
| 4 |
|
| 5 |
use_ok('Dancer2::Core::Factory'); |
| 6 |
|
| 7 |
my $factory = Dancer2::Core::Factory->new; |
| 8 |
isa_ok( $factory, 'Dancer2::Core::Factory' ); |
| 9 |
can_ok( $factory, 'create' ); |
| 10 |
|
| 11 |
for my $class ('template_toolkit', '+Dancer2::Template::TemplateToolkit') { |
| 12 |
|
| 13 |
my $template = Dancer2::Core::Factory->create( |
| 14 |
'template', $class, layout => 'mylayout' |
| 15 |
); |
| 16 |
|
| 17 |
isa_ok( $template, 'Dancer2::Template::TemplateToolkit' ); |
| 18 |
is( $template->{'layout'}, 'mylayout', 'Correct layout set in the template' ); |
| 19 |
} |
| 20 |
|