Skip to content

Commit

Permalink
Support to generate codecov's badge.
Browse files Browse the repository at this point in the history
  • Loading branch information
karupanerura committed Aug 11, 2015
1 parent 0a06b3a commit 6b00377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Minilla/Project.pm
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ sub regenerate_readme_md {
if ($badge eq 'coveralls') {
push @badges, "[![Coverage Status](https://img.shields.io/coveralls/$user_name/$repository_name/master.svg?style=flat)](https://coveralls.io/r/$user_name/$repository_name?branch=master)"
}
if ($badge eq 'codecov') {
push @badges, "[![Coverage Status](http://codecov.io/github/$user_name/$repository_name/coverage.svg?branch=master)](https://codecov.io/github/$user_name/$repository_name?branch=master)";
}
if ($badge eq 'gitter') {
push @badges, "[![Gitter chat](https://badges.gitter.im/$user_name/$repository_name.png)](https://gitter.im/$user_name/$repository_name)";
}
Expand Down
3 changes: 2 additions & 1 deletion t/project/badge.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ subtest 'Badge' => sub {
subtest 'Badges exist' => sub {
write_minil_toml({
name => 'Acme-Foo',
badges => ['travis', 'coveralls', 'gitter'],
badges => ['travis', 'coveralls', 'gitter', 'codecov'],
});
$project->regenerate_files;

Expand All @@ -49,6 +49,7 @@ subtest 'Badge' => sub {
"[![Build Status](https://travis-ci.org/tokuhirom/Minilla.svg?branch=master)](https://travis-ci.org/tokuhirom/Minilla)",
"[![Coverage Status](https://img.shields.io/coveralls/tokuhirom/Minilla/master.svg?style=flat)](https://coveralls.io/r/tokuhirom/Minilla?branch=master)",
"[![Gitter chat](https://badges.gitter.im/tokuhirom/Minilla.png)](https://gitter.im/tokuhirom/Minilla)",
"[![Coverage Status](http://codecov.io/github/tokuhirom/Minilla/coverage.svg?branch=master)](https://codecov.io/github/tokuhirom/Minilla?branch=master)",
];
my $expected = join(' ', @$badge_markdowns);
is $got, $expected;
Expand Down

0 comments on commit 6b00377

Please sign in to comment.