d};
like $err, qr{statocles -h},
'reports pod from bin/statocles, not Statocles';
isnt $exit, 0;
chdir $cwd;
};
subtest 'unknown command specified' => sub {
my $cwd = cwd;
'};
like $err, qr{statocles -h},
'reports pod from bin/statocles, not Statocles';
isnt $exit, 0;
chdir $cwd;
};
subtest 'config file missing' => sub {
subtest 'no site.yml f
like $err, qr{\QERROR: Could not find config file "site.yml"}
or diag $err;
isnt $exit, 0;
chdir $cwd;
};
subtest 'custom config file missing' => sub {
st-child' );
if ( ok $elem, 'older button exists' ) {
isnt $elem->tag, 'a', 'older button is not a link';
}
};
st-child' );
if ( ok $elem, 'newer button exists' ) {
isnt $elem->tag, 'a', 'newer button is not a link';
}
};
st-child' );
if ( ok $elem, 'older button exists' ) {
isnt $elem->tag, 'a', 'older button is not a link';
}
};
ure { $app->command( @args ) };
ok !$out, 'blog error is on stderr' or diag $out;
isnt $exit, 0;
like $err, qr{\QERROR: Unknown command "foo"}, "contains error message";
ure { $app->command( @args ) };
ok !$out, 'blog error is on stderr' or diag $out;
isnt $exit, 0;
like $err, qr{\QERROR: Missing command}, "contains error message";
like
is required when \$EDITOR is not set};
like $err, qr{blog post <title>};
isnt $exit, 0;
};
subtest 'default document' => sub {
no warnings 'redefi
ture { $app->command( @args ) };
ok !$out, 'app error is on stderr' or diag $out;
isnt $exit, 0;
like $err, qr{\QERROR: Unknown command "foo"}, "contains error message";
ture { $app->command( @args ) };
ok !$out, 'app error is on stderr' or diag $out;
isnt $exit, 0;
like $err, qr{\QERROR: Missing command}, "contains error message";
like
as no commands}, 'good error message'
or diag "STDERR: $err";
ok !$out, 'nothing on stdout' or diag "STDOUT: $out";
isnt $exit, 0, 'nonzero exit';
};
};
done_testing;
);
my ( $out, $err, $exit ) = capture { Statocles->run( @args ) };
isnt $exit, 0;
ok !$out, 'nothing on stdout' or diag "STDOUT: $out";
like $err
efault',
);
my $tmpl = $theme->template( site => 'sitemap.xml' );
$theme->clear;
isnt refaddr $theme->template( site => 'sitemap.xml' ), refaddr $tmpl, 'new object created';
};
subte