diff options
author | Austin Clements <amdragon@mit.edu> | 2014-09-03 11:28:34 -0400 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-09-07 20:01:01 +0200 |
commit | 3d39d346d793b9bea0c23ae2c16600feab11ee19 (patch) | |
tree | 3c80dc78e3451f7e3f14664a776e10b3e03ed756 /test | |
parent | ef5e66ae8e84fce75154417dd51be72f78ec1f45 (diff) |
cli: Be more helpful when .notmuch-config does not exist
Previously, if the user ran any subcommand that required a
configuration (e.g., notmuch new) but didn't have a configuration,
notmuch would give the rather un-friendly and un-actionable message
Error reading configuration file .notmuch-config: No such file or directory
Since this condition is expected for new users, this patch adds
specific handling for the file-not-found case to give a message that
is friendly and actionable.
Diffstat (limited to 'test')
-rwxr-xr-x | test/T040-setup.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/T040-setup.sh b/test/T040-setup.sh index 124ef1c8..b1972e70 100755 --- a/test/T040-setup.sh +++ b/test/T040-setup.sh @@ -3,6 +3,12 @@ test_description='"notmuch setup"' . ./test-lib.sh +test_begin_subtest "Notmuch new without a config suggests notmuch setup" +output=$(notmuch --config=new-notmuch-config new 2>&1) +test_expect_equal "$output" "\ +Configuration file new-notmuch-config not found. +Try running 'notmuch setup' to create a configuration." + test_begin_subtest "Create a new config interactively" notmuch --config=new-notmuch-config > /dev/null <<EOF Test Suite |