Fix tests that rely on stubbed table printer output
This commit is contained in:
parent
6490d7717c
commit
20e30453d3
2 changed files with 8 additions and 4 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/MakeNowJust/heredoc"
|
||||
"github.com/cli/cli/pkg/iostreams"
|
||||
"github.com/cli/cli/utils"
|
||||
"github.com/google/shlex"
|
||||
"github.com/spf13/cobra"
|
||||
|
|
@ -166,8 +167,9 @@ func aliasList(cmd *cobra.Command, args []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// TODO: connect to per-command io streams
|
||||
tp := utils.NewTablePrinter(defaultStreams)
|
||||
tp := utils.NewTablePrinter(&iostreams.IOStreams{
|
||||
Out: cmd.OutOrStdout(),
|
||||
})
|
||||
|
||||
aliasMap := aliasCfg.All()
|
||||
keys := []string{}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import (
|
|||
"github.com/cli/cli/pkg/cmd/pr/shared"
|
||||
"github.com/cli/cli/pkg/cmdutil"
|
||||
"github.com/cli/cli/pkg/githubtemplate"
|
||||
"github.com/cli/cli/pkg/iostreams"
|
||||
"github.com/cli/cli/pkg/text"
|
||||
"github.com/cli/cli/utils"
|
||||
"github.com/spf13/cobra"
|
||||
|
|
@ -548,8 +549,9 @@ func issueCreate(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
func printIssues(w io.Writer, prefix string, totalCount int, issues []api.Issue) {
|
||||
// TODO: accept io streams via argument
|
||||
table := utils.NewTablePrinter(defaultStreams)
|
||||
io := &iostreams.IOStreams{Out: w}
|
||||
io.SetStdoutTTY(utils.IsTerminal(w))
|
||||
table := utils.NewTablePrinter(io)
|
||||
for _, issue := range issues {
|
||||
issueNum := strconv.Itoa(issue.Number)
|
||||
if table.IsTTY() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue