App-Chronicle

 view release on metacpan or  search on metacpan

t/test-archive-links.t  view on Meta::CPAN

my %data;
my $link = "/some_blog_post.html";

$data{ 'body' } = "This is **bold**";
$data{ 'link' } = Chronicle::URI->new($link);
$data{ 'date' } = scalar( localtime() );



#
#  Run through the plugin and verify the link has a date-prefix now
#
my $out = Chronicle::Plugin::Archived::on_insert( undef, data => \%data );


#
#  The body, date, and title won't have changed.
#
foreach my $key (qw! body date title !)
{
    is( $out->{ $key }, $data{ $key }, "The blog field is unchanged $key" );

t/test-html-tidy.t  view on Meta::CPAN


#
#  Create a fake blog-post
#
my %data;
$data{ 'body' }  = "<P>This paragraph is unclosed";
$data{ 'title' } = "Irrelevent";


#
#  Run through the plugin and verify that the input hasn't changed.
#
#  (Because no "format" key exists in the hash.)
#
my $out = Chronicle::Plugin::Tidy::on_insert( undef, data => \%data );

is( $out->{ 'body' },
    "<p>This paragraph is unclosed</p>",
    "The trailing P was fixed" );

t/test-markdown-formatter.t  view on Meta::CPAN



#
#  Create some data
#
my %data;
$data{ 'body' } = "This is **bold**";


#
#  Run through the plugin and verify that the input hasn't changed.
#
#  (Because no "format" key exists in the hash.)
#
my $f = Chronicle::Plugin::Markdown::on_insert( undef, data => \%data );
is( $f->{ 'body' }, $data{ 'body' },
    "Body is unchanged with no formatter set" );

#
#  Now we'll set a format type, and ensure that this has caused
# the expected expansion to happen.

t/test-multimarkdown-formatter.t  view on Meta::CPAN

    #  Create some data
    #
    my %data;
    $data{ 'body' } =
      "Here is some text containing a footnote[^somesamplefootnote]. You can then continue your thought...

[^somesamplefootnote]: Here is the text of the footnote itself.";


    #
    #  Run through the plugin and verify that the input hasn't changed.
    #
    #  (Because no "format" key exists in the hash.)
    #
    my $f =
      Chronicle::Plugin::MultiMarkdown::on_insert( undef, data => \%data );
    is( $f->{ 'body' },
        $data{ 'body' },
        "Body is unchanged with no formatter set" );

    #

t/test-publish-future.t  view on Meta::CPAN

#
#  Create a fake blog-post
#
my %data;
$data{ 'body' }    = "This is **bold**";
$data{ 'publish' } = scalar( localtime() );
$data{ 'publish' } =~ s/(20[0-9]+)/2099/g;


#
#  Run through the plugin and verify the the post won't be added.
#
my $out = Chronicle::Plugin::PostSpooler::on_insert( undef, data => \%data );
is( $out, undef, "The future post won't be made live" );

#
#  OK now try a post that is in the past.
#
$data{ 'publish' } =~ s/2099/1999/g;

#

t/test-textile-formatter.t  view on Meta::CPAN



#
#  Create some data
#
my %data;
$data{ 'body' } = "This is *bold*";


#
#  Run through the plugin and verify that the input hasn't changed.
#
#  (Because no "format" key exists in the hash.)
#
my $f = Chronicle::Plugin::Textile::on_insert( undef, data => \%data );
is( $f->{ 'body' }, $data{ 'body' },
    "Body is unchanged with no formatter set" );

#
#  Now we'll set a format type, and ensure that this has caused
# the expected expansion to happen.



( run in 2.182 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )