Skip to content

Commit

Permalink
replace SetDefaultOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
colesnodgrass committed Dec 10, 2024
1 parent 9c07ef8 commit c4f92c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/local/k8s/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (

func TestLogger_HandleWarningHeader(t *testing.T) {
b := bytes.NewBufferString("")
pterm.SetDefaultOutput(b)
pterm.Debug.Writer = b
pterm.EnableDebugMessages()
// remove color codes from output
pterm.DisableColor()
t.Cleanup(func() {
pterm.SetDefaultOutput(os.Stdout)
pterm.Debug.Writer = os.Stdout
pterm.DisableDebugMessages()
pterm.EnableColor()
})
Expand Down
4 changes: 3 additions & 1 deletion internal/cmd/local/local_deployments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import (

func TestDeploymentsCmd(t *testing.T) {
b := bytes.NewBufferString("")
pterm.Info.Writer = b
// SetDefaultOutput isn't overriding the Info.Writer
pterm.SetDefaultOutput(b)
pterm.EnableDebugMessages()
// remove color codes from output
pterm.DisableColor()
t.Cleanup(func() {
pterm.Info.Writer = os.Stdout
pterm.SetDefaultOutput(os.Stdout)
pterm.DisableDebugMessages()
pterm.EnableColor()
Expand Down

0 comments on commit c4f92c5

Please sign in to comment.