Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Extract CommitMessageHelper into spec/support

[#26437519]
  • Loading branch information...
commit 064966d03025d0a4b4b663b9f991813125f7dd55 1 parent 1e21f79
Steven Harman authored
1  .rspec
... ...
@@ -1,3 +1,4 @@
1 1
 --colour
  2
+-I spec/support
2 3
 -r rspec-spies
3 4
 -r pry
18  spec/git_tracker/commit_message_spec.rb
... ...
@@ -1,6 +1,8 @@
1 1
 require 'git_tracker/commit_message'
  2
+require 'commit_message_helper'
2 3
 
3 4
 describe GitTracker::CommitMessage do
  5
+  include CommitMessageHelper
4 6
 
5 7
   it "requires path to the temporary commit message file" do
6 8
     -> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
@@ -18,20 +20,4 @@
18 20
     end
19 21
   end
20 22
 
21  
-  def example_commit_message(pattern_to_match)
22  
-    return <<-EXAMPLE
23  
-Got Jenny's number, gonna' make her mine!
24  
-
25  
-#{pattern_to_match}
26  
-# Please enter the commit message for your changes. Lines starting
27  
-# with '#' will be ignored, and an empty message aborts the commit.
28  
-# On branch get_jennys_number_#8675309
29  
-# Changes to be committed:
30  
-#   (use "git reset HEAD <file>..." to unstage)
31  
-#
32  
-# new file:   fake_file.rb
33  
-#
34  
-
35  
-EXAMPLE
36  
-  end
37 23
 end
20  spec/support/commit_message_helper.rb
... ...
@@ -0,0 +1,20 @@
  1
+module CommitMessageHelper
  2
+
  3
+  def example_commit_message(pattern_to_match)
  4
+    return <<-EXAMPLE
  5
+Got Jenny's number, gonna' make her mine!
  6
+
  7
+#{pattern_to_match}
  8
+# Please enter the commit message for your changes. Lines starting
  9
+# with '#' will be ignored, and an empty message aborts the commit.
  10
+# On branch get_jennys_number_#8675309
  11
+# Changes to be committed:
  12
+#   (use "git reset HEAD <file>..." to unstage)
  13
+#
  14
+# new file:   fake_file.rb
  15
+#
  16
+
  17
+EXAMPLE
  18
+  end
  19
+
  20
+end

0 notes on commit 064966d

Please sign in to comment.
Something went wrong with that request. Please try again.