3 test_description='"notmuch setup"'
4 . $(dirname "$0")/test-lib.sh || exit 1
6 test_begin_subtest "Notmuch new without a config suggests notmuch setup"
7 output=$(notmuch --config=new-notmuch-config new 2>&1)
8 test_expect_equal "$output" "\
9 Error: cannot load config file.
10 Try running 'notmuch setup' to create a configuration."
12 test_begin_subtest "Create a new config interactively"
13 notmuch --config=new-notmuch-config > log.${test_count} <<EOF
15 test.suite@example.com
16 another.suite@example.com
23 expected_dir=$NOTMUCH_SRCDIR/test/setup.expected-output
24 test_expect_equal_file ${expected_dir}/config-with-comments new-notmuch-config
26 test_begin_subtest "setup consistent with config-set for single items"
27 # note this relies on the config state from the previous test.
28 notmuch --config=new-notmuch-config config list > list.setup
29 notmuch --config=new-notmuch-config config set search.exclude_tags baz
30 notmuch --config=new-notmuch-config config list > list.config
31 test_expect_equal_file list.setup list.config
33 test_begin_subtest "notmuch with a config but without a database suggests notmuch new"
34 notmuch 2>&1 | notmuch_dir_sanitize > OUTPUT
36 Notmuch is configured, but no database was found.
37 You probably want to run "notmuch new" now to create a database.
39 Note that the first run of "notmuch new" can take a very long time
40 and that the resulting database will use roughly the same amount of
41 storage space as the email being indexed.
44 test_expect_equal_file EXPECTED OUTPUT