From 31a4607a7de70c8c1df4903475cdb472105dcc07 Mon Sep 17 00:00:00 2001 From: Justin Proffitt Date: Wed, 7 Aug 2019 20:58:35 -0400 Subject: [PATCH] Add tests for the excluding tags with -not --- features/tagging.feature | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/features/tagging.feature b/features/tagging.feature index cc686673..2cbf7ce1 100644 --- a/features/tagging.feature +++ b/features/tagging.feature @@ -50,3 +50,35 @@ Feature: Tagging @foo : 1 @bar : 1 """ + + Scenario: Excluding a tag should filter it + Given we use the config "basic.yaml" + When we run "jrnl today: @foo came over, we went to a bar" + When we run "jrnl I have decided I did not enjoy that @bar" + When we run "jrnl --tags -not @bar" + Then the output should be + """ + @foo : 1 + """ + + Scenario: Excluding a tag should filter an entry, even if an unfiltered tag is in that entry + Given we use the config "basic.yaml" + When we run "jrnl today: I do @not think this will show up @thought" + When we run "jrnl today: I think this will show up @thought" + When we run "jrnl --tags -not @not" + Then the output should be + """ + @thought : 1 + """ + + Scenario: Excluding multiple tags should filter them + Given we use the config "basic.yaml" + When we run "jrnl today: I do @not think this will show up @thought" + When we run "jrnl today: I think this will show up @thought" + When we run "jrnl today: This should @never show up @thought" + When we run "jrnl today: What a nice day for filtering @thought" + When we run "jrnl --tags -not @not @never" + Then the output should be + """ + @thought : 2 + """