Skip to content

Commit 4a96679

Browse files
authored
Fix windows build (#591)
Signed-off-by: James Couball <jcouball@yahoo.com>
1 parent 6f2b3fd commit 4a96679

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/units/test_lib.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env ruby
22

33
require File.dirname(__FILE__) + '/../test_helper'
4+
require "fileutils"
45

56
# tests all the low level git communication
67
#
@@ -51,8 +52,13 @@ def test_commit_with_no_verify
5152
move_file(pre_commit_path, pre_commit_path_bak)
5253

5354
# Adds a pre-commit file that should throw an error
54-
create_file(pre_commit_path, 'echo Pre-commit file. Shoud not execute; exit 1') # Error when executed
55-
File.chmod(0111, pre_commit_path)
55+
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)
5662

5763
create_file("#{@wdir}/test_file_2", 'content test_file_2')
5864
@lib.add('test_file_2')

0 commit comments

Comments
 (0)