GitHubWebhooks2Ikachan/Events/PullRequestReviewComment.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 1 SCAR 6.9
CC
1
Cov
0%
call
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::GitHubWebhooks2Ikachan::Events::PullRequestReviewComment;
2 use strict;
3 use warnings;
4 use utf8;
5 use String::IRC;
6  
7 sub call {
8 my ($class, $context) = @_;
9  
10 my $comment = $context->dat->{comment};
11  
12 (my $comment_body = $comment->{body}) =~ s/\r?\n.*//g;
13 my $user_name = $comment->{user}->{login};
14 my $url = $comment->{html_url};
15  
16 my ($pull_request_number) = $comment->{pull_request_url} =~ m!/(\d+)\Z!;
17  
18 my $main_text = "[review comment (#$pull_request_number)] $comment_body (\@$user_name)";
19 return String::IRC->new($main_text)->green . " $url";
20 }
21  
22 1;
23