We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f2b3fd commit 4a96679Copy full SHA for 4a96679
tests/units/test_lib.rb
@@ -1,6 +1,7 @@
1
#!/usr/bin/env ruby
2
3
require File.dirname(__FILE__) + '/../test_helper'
4
+require "fileutils"
5
6
# tests all the low level git communication
7
#
@@ -51,8 +52,13 @@ def test_commit_with_no_verify
51
52
move_file(pre_commit_path, pre_commit_path_bak)
53
54
# Adds a pre-commit file that should throw an error
- create_file(pre_commit_path, 'echo Pre-commit file. Shoud not execute; exit 1') # Error when executed
55
- File.chmod(0111, pre_commit_path)
+ create_file(pre_commit_path, <<~PRE_COMMIT_SCRIPT)
56
+ #!/bin/sh
57
+ echo "pre-commit script exits with an error"
58
+ exit 1
59
+ PRE_COMMIT_SCRIPT
60
+
61
+ FileUtils.chmod("+x", pre_commit_path)
62
63
create_file("#{@wdir}/test_file_2", 'content test_file_2')
64
@lib.add('test_file_2')
0 commit comments