HiD
view release on metacpan or search on metacpan
t/cmd-publish.t view on Meta::CPAN
);
}
TODO: { # embedded layouts
local $TODO = 'embedded layouts all fucked up';
write_fixture_file( '_layouts/embedded_post.html' , << 'EOL' );
---
layout: default
----
EMBEDDED POST: {{content}}
EOL
write_fixture_file( '_posts/2012-05-06-embedded_layout.mkdn' , << 'EOL' );
---
layout: embedded_post
title: this is a test post
---
this is a test embedded post, and it's called {{page.title}}
EOL
_assert_good_run();
file_exists_ok( '_site/2012/05/06/embedded_layout.html' , 'expected post file');
file_contains_like(
'_site/2012/05/06/embedded_layout.html' ,
qr|EMBEDDED POST: this is a embedded test post, and it's called this is a test post| ,
'expected content'
);
}
## tests to write
# setting 'processor' in config (use '+$MODULE' to bypass wrapper, etc.)
# setting 'destination' in config
# setting 'permalink' in config (and then still overriding in specific post)
# setting fully custom permalink format
# permalink with categories
expected_output_regex => qr/OUTER.*INNER.*test content/m ,
subject => $inner,
test_content => 'test content'
}
);
run_tests(
"render without write" ,
[ 'Test::HiD::Layout' ] ,
{
expected_output_regex => qr/EMBED: embed test content/,
test_content => 'embed test content' ,
subject => HiD::Layout->new({
name => 'embed' ,
content => 'EMBED: [% content %]' ,
processor => $template ,
}),
},
);
run_tests(
"layout metadata folded into page" ,
[ 'Test::HiD::Layout' ] ,
{
expected_output_regex => qr/yes, it worked it did/,
( run in 1.335 second using v1.01-cache-2.11-cpan-71847e10f99 )