]> git.ipfire.org Git - thirdparty/git.git/blame - t/t0018-advice.sh
The sixth batch
[thirdparty/git.git] / t / t0018-advice.sh
CommitLineData
b3b18d16
HW
1#!/bin/sh
2
3test_description='Test advise_if_enabled functionality'
4
5. ./test-lib.sh
6
7test_expect_success 'advice should be printed when config variable is unset' '
8 cat >expect <<-\EOF &&
9 hint: This is a piece of advice
10 hint: Disable this message with "git config advice.nestedTag false"
11 EOF
12 test-tool advise "This is a piece of advice" 2>actual &&
13 test_i18ncmp expect actual
14'
15
16test_expect_success 'advice should be printed when config variable is set to true' '
17 cat >expect <<-\EOF &&
18 hint: This is a piece of advice
19 hint: Disable this message with "git config advice.nestedTag false"
20 EOF
21 test_config advice.nestedTag true &&
22 test-tool advise "This is a piece of advice" 2>actual &&
23 test_i18ncmp expect actual
24'
25
26test_expect_success 'advice should not be printed when config variable is set to false' '
27 test_config advice.nestedTag false &&
28 test-tool advise "This is a piece of advice" 2>actual &&
29 test_must_be_empty actual
30'
31
32test_done