App-GitHooks-Plugin-BlockProductionCommits
view release on metacpan or search on metacpan
737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
plugins
=> [
'App::GitHooks::Plugin::BlockProductionCommits'
],
);
# Set up test files.
ok_add_files(
files
=>
$files
,
repository
=>
$repository
,
);
# Try to commit.
my
$stderr
;
lives_ok(
sub
{
$stderr
= Capture::Tiny::capture_stderr(
sub
{
$repository
->run(
'commit'
,
'-m'
,
'Test message.'
);
}
);
note(
$stderr
);
},
'Commit the changes.'
,
);
if
(
$test
->{
'allow'
} )
{
unlike(
$stderr
,
$failure
,
"The output matches expected results."
,
);
}
else
{
like(
$stderr
,
$failure
,
"The output matches expected results."
,
);
}
}
);
}
t/12-missing_config.t view on Meta::CPAN
414243444546474849505152535455565758596061626364656667686970
plugins
=> [
'BlockProductionCommits'
],
);
# Set up test files.
ok_add_files(
files
=>
$files
,
repository
=>
$repository
,
);
# Try to commit.
my
$stderr
;
lives_ok(
sub
{
$stderr
= Capture::Tiny::capture_stderr(
sub
{
$repository
->run(
'commit'
,
'-m'
,
'Test message.'
);
}
);
note(
$stderr
);
},
'Commit the changes.'
,
);
like(
$stderr
,
qr/\QYou must define 'env_variable' in the [BlockProductionCommits] section of your githooksrc config\E/
,
"The output matches expected results."
,
);
( run in 0.247 second using v1.01-cache-2.11-cpan-05444aca049 )