diff options
| author | Ludovic LANGE <ll-notmuchmail@lange.nom.fr> | 2016-03-06 07:56:28 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2016-05-19 08:02:43 -0300 |
| commit | 7e6e23c36e290d4b22b0449766a6ef2107f1ef6c (patch) | |
| tree | 84bfc83815e67c8469689c0bea30df2cbb37ad98 /test/T395-ruby.sh | |
| parent | b183f2635eaf323066f26c7ca22d931d4f4ccd3a (diff) | |
ruby: add bindings for `notmuch_database_get_all_tags`
The Ruby bindings were missing a way to get all the tags of the
database. Now you should be able to access this with the public
instance method `all_tags` of your database object.
Example of use:
notmuchdb = Notmuch::Database.new path, { :create => false,
:mode => Notmuch::MODE_READ_ONLY }
my_tags = notmuchdb.all_tags
my_tags.each { |tag|
print tag
}
my_tags.destroy!
Amended by db: improve error reporting, add test
Diffstat (limited to 'test/T395-ruby.sh')
| -rwxr-xr-x | test/T395-ruby.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index d5cade8f..20e06917 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -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 |
