(t *testing.T)
| 847 | } |
| 848 | |
| 849 | func Test_getBodyPrompt(t *testing.T) { |
| 850 | ios, _, _, _ := iostreams.Test() |
| 851 | ios.SetStdinTTY(true) |
| 852 | ios.SetStdoutTTY(true) |
| 853 | |
| 854 | pm := prompter.NewMockPrompter(t) |
| 855 | pm.RegisterPassword("Paste your secret:", func(_ string) (string, error) { |
| 856 | return "cool secret", nil |
| 857 | }) |
| 858 | |
| 859 | body, err := getBody(&SetOptions{ |
| 860 | IO: ios, |
| 861 | Prompter: pm, |
| 862 | }) |
| 863 | assert.NoError(t, err) |
| 864 | assert.Equal(t, string(body), "cool secret") |
| 865 | } |
| 866 | |
| 867 | func Test_getSecretsFromOptions(t *testing.T) { |
| 868 | genFile := func(s string) string { |
nothing calls this directly
no test coverage detected