Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Test AlecAivazis/survey/pull/335 #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion features/bootstrap/godog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"

"github.com/cucumber/godog"
"github.com/nhatthm/consoledog"
"github.com/nhatthm/surveyexpect"
"github.com/stretchr/testify/assert"

Expand Down Expand Up @@ -43,10 +44,13 @@ func TestIntegration(t *testing.T) {
}

p := NewPrompt()
cm := consoledog.New(t)
m := surveydog.New(t).
WithStarter(p.WithStdio)
WithStarter(p.WithStdio).
WithConsole(cm)

RunSuite(t, "..", func(_ *testing.T, ctx *godog.ScenarioContext) {
cm.RegisterContext(ctx)
m.RegisterContext(ctx)
p.RegisterContext(ctx)
})
Expand Down
12 changes: 12 additions & 0 deletions features/password.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ Feature: Password

Then ask for password "Enter password:", get interrupted

Scenario: Multiple Password prompts
Given I see a password prompt "Enter username:", I answer "user@example.org"
And I see a password prompt "Enter password:", I answer "123456"

Then ask for password "Enter username:", receive "user@example.org"
And ask for password "Enter password:", receive "123456"

And console output is:
"""
? Enter username: ****************
? Enter password: ******
"""
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ require (
golang.org/x/text v0.3.6 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

replace (
github.com/AlecAivazis/survey/v2 v2.2.9 => github.com/PierreBtz/survey/v2 v2.2.8-0.20210212151517-a593d1348118
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61
github.com/Netflix/go-expect v0.0.0-20201125194554-85d881c3777e h1:YYUPbL3iB9+Y/JYEXjCi9AolqiKIIJX/2aRR9TuKD6w=
github.com/Netflix/go-expect v0.0.0-20201125194554-85d881c3777e/go.mod h1:68ORG0HSEWDuH5Eh73AFbYWZ1zT4Y+b0vhOa+vZRUdI=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PierreBtz/survey/v2 v2.2.8-0.20210212151517-a593d1348118 h1:1P7Hl/RI85CUhwmFyHgpMacbWCiDzlI8XPYeUYztEH0=
github.com/PierreBtz/survey/v2 v2.2.8-0.20210212151517-a593d1348118/go.mod h1:9DYvHgXtiXm6nCn+jXnOXLKbH+Yo9u8fAS/SduGdoPk=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
Expand Down