Skip to content

Commit 7fe2b39

Browse files
committed
test: Add tests for tag:/[tag]/{tag} prefixes
See-also: 9ca300b (hook: Allow tag:/[tag]/{tag} prefixes in subject)
1 parent 6829143 commit 7fe2b39

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/validation.bats

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,28 @@ EOF
154154
refute_line --partial "Limit the subject line to 50 characters"
155155
}
156156

157+
@test "validation: ignores tag: prefix when checking subject line length" {
158+
echo "n" > $FAKE_TTY
159+
run git commit -m "tag: Add foo bar string to my_file"
160+
161+
assert_success
162+
refute_line --partial "Limit the subject line to 50 characters"
163+
}
164+
@test "validation: ignores [<tag>] prefix when checking subject line length" {
165+
echo "n" > $FAKE_TTY
166+
run git commit -m "[tag] Add foo bar string to my_file"
167+
168+
assert_success
169+
refute_line --partial "Limit the subject line to 50 characters"
170+
}
171+
@test "validation: ignores {<tag>} prefix when checking subject line length" {
172+
echo "n" > $FAKE_TTY
173+
run git commit -m "{tag} Add foo bar string to my_file"
174+
175+
assert_success
176+
refute_line --partial "Limit the subject line to 50 characters"
177+
}
178+
157179
# 3. Capitalize the subject line
158180
# ------------------------------------------------------------------------------
159181

0 commit comments

Comments
 (0)