Permalink
Browse files

Extract CommitMessageHelper into spec/support

[#26437519]
  • Loading branch information...
stevenharman committed Mar 20, 2012
1 parent 1e21f79 commit 064966d03025d0a4b4b663b9f991813125f7dd55
Showing with 23 additions and 16 deletions.
  1. +1 −0 .rspec
  2. +2 −16 spec/git_tracker/commit_message_spec.rb
  3. +20 −0 spec/support/commit_message_helper.rb
View
1 .rspec
@@ -1,3 +1,4 @@
--colour
+-I spec/support
-r rspec-spies
-r pry
@@ -1,6 +1,8 @@
require 'git_tracker/commit_message'
+require 'commit_message_helper'
describe GitTracker::CommitMessage do
+ include CommitMessageHelper
it "requires path to the temporary commit message file" do
-> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
@@ -18,20 +20,4 @@
end
end
- def example_commit_message(pattern_to_match)
- return <<-EXAMPLE
-Got Jenny's number, gonna' make her mine!
-
-#{pattern_to_match}
-# Please enter the commit message for your changes. Lines starting
-# with '#' will be ignored, and an empty message aborts the commit.
-# On branch get_jennys_number_#8675309
-# Changes to be committed:
-# (use "git reset HEAD <file>..." to unstage)
-#
-# new file: fake_file.rb
-#
-
-EXAMPLE
- end
end
@@ -0,0 +1,20 @@
+module CommitMessageHelper
+
+ def example_commit_message(pattern_to_match)
+ return <<-EXAMPLE
+Got Jenny's number, gonna' make her mine!
+
+#{pattern_to_match}
+# Please enter the commit message for your changes. Lines starting
+# with '#' will be ignored, and an empty message aborts the commit.
+# On branch get_jennys_number_#8675309
+# Changes to be committed:
+# (use "git reset HEAD <file>..." to unstage)
+#
+# new file: fake_file.rb
+#
+
+EXAMPLE
+ end
+
+end

0 comments on commit 064966d

Please sign in to comment.