diff options
| -rw-r--r-- | hipchat-stfu.pl | 2 | ||||
| -rwxr-xr-x | test.pl | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl index 10fcc23..22c288c 100644 --- a/hipchat-stfu.pl +++ b/hipchat-stfu.pl @@ -29,7 +29,7 @@ sub prettify_hipchat { # Construct start message if ($link) { - $input =~ s/ Created by/\n$link\nCreated by/g; + $input =~ s/Created by (.+)$/($1) ($link)/g; } return $input; @@ -5,15 +5,11 @@ use strict; use Test::More tests => 9; require 'prettify_hipchat.pl'; -my $title_message = <<'END_MESSAGE'; -SC-1000 : Some kind of issue text that is kind of long and describes the problem that we saw during testing. -https://somecompany.atlassian.net/browse/SC-2169 -Created by Person Name -END_MESSAGE -chomp($title_message); is(prettify_hipchat(' <img src="https://somecompany.atlassian.net/images/16jira.png" height="16" width="16" /> <a href="https://somecompany.atlassian.net/browse/SC-2169"><b>SC-1000 : Some kind of issue text that is kind of long and describes the problem that we saw during testing.</b></a> Created by <a href="https://somecompany.atlassian.net/secure/ViewProfile.jspa?name=PersonN">Person Name</a><br />'), - $title_message, + 'SC-1000 : Some kind of issue text that is kind of long and describes the ' . + 'problem that we saw during testing. (Person Name) ' . + '(https://somecompany.atlassian.net/browse/SC-2169)', 'Title, link, and creator'); is(prettify_hipchat('<span style="color: dimgrey;">Type:</span> <img src="https://somecompany.atlassian.net/images/icons/issuetypes/bug.png" height="16" width="16" /> Bug '), 'Type: Bug', |
