@@ -91,7 +91,7 @@ func TestCreateHook(t *testing.T) {
91
91
92
92
contentBytes , err := os .ReadFile (fmt .Sprintf ("%s/commit-msg" , hookPath ))
93
93
assert .Nil (t , err )
94
- assert .Contains (t , string (contentBytes ), "root/commit-message-check validate" )
94
+ assert .Contains (t , string (contentBytes ), ` "root/commit-message-check" validate` )
95
95
})
96
96
97
97
t .Run ("returns any error" , func (t * testing.T ) {
@@ -134,15 +134,15 @@ func TestWriteContent(t *testing.T) {
134
134
135
135
writeContent (buffer , "usr/tmp" )
136
136
137
- assert .Contains (t , buffer .String (), " #!/bin/sh\n \n " )
137
+ assert .Contains (t , buffer .String (), ` #!/bin/sh\n\n` )
138
138
})
139
139
140
- t .Run ("executes commit-message-check with root path" , func (t * testing.T ) {
140
+ t .Run ("executes commit-message-check with root path and quotes path to handle spaces " , func (t * testing.T ) {
141
141
buffer .Reset ()
142
142
143
143
writeContent (buffer , "usr/tmp" )
144
144
145
- assert .Contains (t , buffer .String (), "usr/tmp/commit-message-check validate $1\n " )
145
+ assert .Contains (t , buffer .String (), ` "usr/tmp/commit-message-check" validate $1\n` )
146
146
})
147
147
148
148
t .Run ("logs any error" , func (t * testing.T ) {
0 commit comments