Skip to content

Commit cff1a71

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

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/validation.bats

+22
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,28 @@ EOF
129129
refute_line --partial "Limit the subject line to 50 characters"
130130
}
131131

132+
@test "validation: ignores tag: prefix when checking subject line length" {
133+
echo "n" > $FAKE_TTY
134+
run git commit -m "tag: Add foo bar string to my_file"
135+
136+
assert_success
137+
refute_line --partial "Limit the subject line to 50 characters"
138+
}
139+
@test "validation: ignores [<tag>] prefix when checking subject line length" {
140+
echo "n" > $FAKE_TTY
141+
run git commit -m "[tag] Add foo bar string to my_file"
142+
143+
assert_success
144+
refute_line --partial "Limit the subject line to 50 characters"
145+
}
146+
@test "validation: ignores {<tag>} prefix when checking subject line length" {
147+
echo "n" > $FAKE_TTY
148+
run git commit -m "{tag} Add foo bar string to my_file"
149+
150+
assert_success
151+
refute_line --partial "Limit the subject line to 50 characters"
152+
}
153+
132154
# 3. Capitalize the subject line
133155
# ------------------------------------------------------------------------------
134156

0 commit comments

Comments
 (0)