Borrow the git test harness to test the commit message.
[git-central.git] / tests / t1000-commit-msg-ticket-hook.sh
1 #!/bin/sh
2
3 test_description='commit-msg ticket hook'
4
5 . ./test-lib.sh
6
7
8 # setup the commit-msg hook
9 install_client_hook 'commit-msg' 'commit-msg'
10
11 test_expect_success 'rejects with bad message' '
12         echo "$test_name" > file &&
13         git add file &&
14         ! git commit -m "first"
15 '
16
17 test_expect_success 'rejects with re:' '
18         echo "$test_name" > file &&
19         git add file &&
20         ! git commit -m "first re: #3200"
21 '
22
23 test_expect_success 'rejects with re no space' '
24         echo "$test_name" > file &&
25         git add file &&
26         ! git commit -m "first re#3200"
27 '
28
29 test_expect_success 'accepts with re' '
30         echo "$test_name" > file &&
31         git add file &&
32         git commit -m "first re #3200"
33 '
34
35 test_expect_success 'accepts with RE' '
36         echo "$test_name" > file &&
37         git add file &&
38         git commit -m "first RE #3200"
39 '
40
41 test_expect_success 'accepts with refs' '
42         echo "$test_name" > file &&
43         git add file &&
44         git commit -m "first refs #3200"
45 '
46
47 test_expect_success 'accepts with qa' '
48         echo "$test_name" > file &&
49         git add file &&
50         git commit -m "first qa #3200"
51 '
52
53 test_done
54