Skip to content

Commit

Permalink
fix: add tests for --with-disabled in 'print' and 'value' command
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Jun 4, 2024
1 parent 3ae2bc0 commit 528a7a1
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/print/tests/with-disabled.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
active="world"
#disabled="true"
2 changes: 2 additions & 0 deletions cmd/print/tests/with-disabled.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--no-color
--with-disabled
13 changes: 13 additions & 0 deletions cmd/print/tests/with-disabled/stderr.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--------------------------------------------------------------------------------
- Output of command from line 1 in [tests/with-disabled.run]:
- [print --no-color]
--------------------------------------------------------------------------------

(no output to stderr)

--------------------------------------------------------------------------------
- Output of command from line 2 in [tests/with-disabled.run]:
- [print --with-disabled]
--------------------------------------------------------------------------------

(no output to stderr)
16 changes: 16 additions & 0 deletions cmd/print/tests/with-disabled/stdout.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--------------------------------------------------------------------------------
- Output of command from line 1 in [tests/with-disabled.run]:
- [print --no-color]
--------------------------------------------------------------------------------

active="world"


--------------------------------------------------------------------------------
- Output of command from line 2 in [tests/with-disabled.run]:
- [print --with-disabled]
--------------------------------------------------------------------------------

active="world"
#disabled="true"

1 change: 1 addition & 0 deletions cmd/value/tests/with-disabled.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#disabled="my-value"
2 changes: 2 additions & 0 deletions cmd/value/tests/with-disabled.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disabled
disabled --with-disabled
14 changes: 14 additions & 0 deletions cmd/value/tests/with-disabled/stderr.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--------------------------------------------------------------------------------
- Output of command from line 1 in [tests/with-disabled.run]:
- [value disabled]
--------------------------------------------------------------------------------

Error: Key [ disabled ] exists, but is commented out - use [--with-disabled] to include it
Run 'dottie value --help' for usage.

--------------------------------------------------------------------------------
- Output of command from line 2 in [tests/with-disabled.run]:
- [value disabled --with-disabled]
--------------------------------------------------------------------------------

(no output to stderr)
13 changes: 13 additions & 0 deletions cmd/value/tests/with-disabled/stdout.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--------------------------------------------------------------------------------
- Output of command from line 1 in [tests/with-disabled.run]:
- [value disabled]
--------------------------------------------------------------------------------

(no output to stdout)

--------------------------------------------------------------------------------
- Output of command from line 2 in [tests/with-disabled.run]:
- [value disabled --with-disabled]
--------------------------------------------------------------------------------

my-value
13 changes: 13 additions & 0 deletions cmd/value/value_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package value_test

import (
"testing"

"github.com/jippi/dottie/pkg/test_helpers"
)

func TestPrintCommand(t *testing.T) {
t.Parallel()

test_helpers.RunFileBasedCommandTests(t, test_helpers.ReadOnly, "value")
}

0 comments on commit 528a7a1

Please sign in to comment.