]> git.notmuchmail.org Git - notmuch/blobdiff - test/T395-ruby.sh
test: only accept short and long options, not silly in-betweens
[notmuch] / test / T395-ruby.sh
index 8b8e6d24db534b0c45bb88f11e2bb3856c5a78da..20e06917fa3f2616750910f4ea58e0fa8b51ad1a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="ruby bindings"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
     test_subtest_missing_external_prereq_["ruby development files"]=t
@@ -83,4 +83,20 @@ EOF
 notmuch count --output=threads tag:inbox > EXPECTED
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "get all tags"
+test_ruby <<"EOF"
+require 'notmuch'
+$maildir = ENV['MAIL_DIR']
+if not $maildir then
+  abort('environment variable MAIL_DIR must be set')
+end
+@db = Notmuch::Database.new($maildir)
+@t = @db.all_tags()
+for tag in @t do
+   print tag,"\n"
+end
+EOF
+notmuch search --output=tags '*' > EXPECTED
+test_expect_equal_file OUTPUT EXPECTED
+
 test_done