Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Allow state change before or after number
Browse files Browse the repository at this point in the history
[#26437519]
  • Loading branch information
stevenharman committed Mar 21, 2012
1 parent 92cbade commit 8f6cab2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/git_tracker/commit_message.rb
Expand Up @@ -7,7 +7,7 @@ def initialize(file)

def mentions_story?(number)
message = File.read(@file)
message =~ %r{\[\w*\s?##{number}\]}
message =~ %r{\[(\w+\s)?##{number}(\s\w+)?\]}
end

end
Expand Down
7 changes: 6 additions & 1 deletion spec/git_tracker/commit_message_spec.rb
Expand Up @@ -22,11 +22,16 @@ def stub_commit_message(story_text)
subject.should be_mentions_story("8675309")
end

it "allows state change and number" do
it "allows state change before number" do
stub_commit_message("[Fixes #8675309]")
subject.should be_mentions_story("8675309")
end

it "allows state change after the number" do
stub_commit_message("[#8675309 Delivered]")
subject.should be_mentions_story("8675309")
end

it "allows surrounding text" do
stub_commit_message("derp de herp [Fixes #8675309] de herp-ity derp")
subject.should be_mentions_story("8675309")
Expand Down

0 comments on commit 8f6cab2

Please sign in to comment.