Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
(MAINT) Update acceptance tests for explain
Browse files Browse the repository at this point in the history
Prior to this commit, the acceptance tests for the explain command
relied on the temporary readme file which existed in the docs folder;
as that temporary file has been removed, the tests have been updated
to use actual documentation instead.
  • Loading branch information
michaeltlombardi committed Jan 27, 2022
1 parent 8581fdb commit f125cce
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions acceptance/explain/explain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Test_Explain_With_No_Args(t *testing.T) {
stdout, stderr, exitCode := testutils.RunAppCommand("explain", "")

// Assert
assert.Contains(t, stdout, "README")
assert.Contains(t, stdout, "telemetry")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand All @@ -34,7 +34,8 @@ func Test_Explain_With_List_Set(t *testing.T) {
stdout, stderr, exitCode := testutils.RunAppCommand("explain --list", "")

// Assert
assert.Contains(t, stdout, "README")
assert.Contains(t, stdout, "telemetry")
assert.Contains(t, stdout, "quick-start")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand All @@ -49,7 +50,7 @@ func Test_Explain_With_Format_Json(t *testing.T) {
stdout, stderr, exitCode := testutils.RunAppCommand("explain --format json", "")

// Assert
assert.Contains(t, stdout, "\"Title\":{\"Short\":\"README\",\"Long\":\"Readme\"")
assert.Contains(t, stdout, "\"Title\":{\"Short\":\"telemetry\",\"Long\":\"Telemetry\"")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand All @@ -64,7 +65,7 @@ func Test_Explain_With_Tag_Filter(t *testing.T) {
stdout, stderr, exitCode := testutils.RunAppCommand("explain --tag meta", "")

// Assert
assert.Contains(t, stdout, "README")
assert.Contains(t, stdout, "telemetry")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand All @@ -79,7 +80,7 @@ func Test_Explain_With_Cateogry_Filter(t *testing.T) {
stdout, stderr, exitCode := testutils.RunAppCommand("explain --category concept", "")

// Assert
assert.Contains(t, stdout, "README")
assert.Contains(t, stdout, "telemetry")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand All @@ -91,10 +92,10 @@ func Test_Explain_With_Single_Target(t *testing.T) {
testutils.SetAppName(APP)

// Exec
stdout, stderr, exitCode := testutils.RunAppCommand("explain README", "")
stdout, stderr, exitCode := testutils.RunAppCommand("explain telemetry", "")

// Assert
assert.Contains(t, stdout, "Puppet Runtime Manager")
assert.Contains(t, stdout, "By default, PRM collects some telemetry during each run.")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}

0 comments on commit f125cce

Please sign in to comment.