Created
March 20, 2012 23:35
Revisions
-
stevenharman created this gist
Mar 20, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ describe "#mentions_story?" do subject { described_class.new(file) } let(:file) { "COMMIT_EDITMSG" } before do File.stub(:read).with(file) { commit_message_text } end context "commit message contains the special Pivotal Tracker story syntax" do it "matches just the number" do let(:commit_message_text) { example_commit_message("[#8675309]") } subject.should be_mentions_story("8675309") end it "matches state change and number" do let(:commit_message_text) { example_commit_message("[Fixes #8675309]") } subject.should be_mentions_story("8675309") end end context "commit message doesn't contain the special Pivotal Tracker story syntax" do it "doesn't match without brackets" do let(:commit_message_text) { example_commit_message("#8675309") } subject.should_not be_mentions_story("8675309") end end end