Skip to content

Commit

Permalink
mimic "<actor> <action>" summaries used in PushHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Oct 26, 2011
1 parent 8ab8c68 commit 409ed1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/events/issue_helpers.rb
Expand Up @@ -11,11 +11,11 @@ def summary_url
end

def summary_message
"[%s] Issue #%d: %s - @%s. %s" % [
"[%s] %s opened issue #%d: %s. %s" % [
repo.name,
issue.user.login,
issue.number,
issue.title,
issue.user.login,
issue.html_url]
rescue
raise_config_error "Unable to build message: #{$!.to_s}"
Expand Down
4 changes: 2 additions & 2 deletions lib/events/pull_request_helpers.rb
Expand Up @@ -11,12 +11,12 @@ def summary_url
end

def summary_message
"[%s] Pull Request #%d (%s -> %s): %s - @%s. %s" % [
"[%s] %s opened pull request #%d (%s -> %s): %s. %s" % [
repo.name,
pull.user.login,
pull.number,
pull.base.label.split(':').last, pull.head.label,
pull.title,
pull.user.login,
pull.html_url]
rescue
raise_config_error "Unable to build message: #{$!.to_s}"
Expand Down
4 changes: 2 additions & 2 deletions test/campfire_test.rb
Expand Up @@ -51,7 +51,7 @@ def test_issues
assert_equal 't', svc.campfire.token
assert_equal 'r', svc.campfire.rooms.first.name
assert_equal 1, svc.campfire.rooms.first.lines.size # 3 + summary
assert_match /\[grit\] Issue #5: booya - @mojombo/i, svc.campfire.rooms.first.lines.first
assert_match /\[grit\] mojombo opened issue #5: booya./i, svc.campfire.rooms.first.lines.first
end

def test_pull
Expand All @@ -62,7 +62,7 @@ def test_pull
assert_equal 't', svc.campfire.token
assert_equal 'r', svc.campfire.rooms.first.name
assert_equal 1, svc.campfire.rooms.first.lines.size # 3 + summary
assert_match /\[grit\] Pull Request #5 \(master -> foo:feature\): booya - @mojombo./i, svc.campfire.rooms.first.lines.first
assert_match /\[grit\] mojombo opened pull request #5 \(master -> foo:feature\): booya./i, svc.campfire.rooms.first.lines.first
end

def test_full_domain
Expand Down

0 comments on commit 409ed1a

Please sign in to comment.