PrompterMock is a mock implementation of Prompter. func TestSomethingThatUsesPrompter(t *testing.T) { // make and configure a mocked Prompter mockedPrompter := &PrompterMock{ AuthTokenFunc: func() (string, error) { panic("mock out the AuthToken method") }, ConfirmFunc: func(promp
| 54 | // |
| 55 | // } |
| 56 | type PrompterMock struct { |
| 57 | // AuthTokenFunc mocks the AuthToken method. |
| 58 | AuthTokenFunc func() (string, error) |
| 59 | |
| 60 | // ConfirmFunc mocks the Confirm method. |
| 61 | ConfirmFunc func(prompt string, defaultValue bool) (bool, error) |
| 62 | |
| 63 | // ConfirmDeletionFunc mocks the ConfirmDeletion method. |
| 64 | ConfirmDeletionFunc func(requiredValue string) error |
| 65 | |
| 66 | // InputFunc mocks the Input method. |
| 67 | InputFunc func(prompt string, defaultValue string) (string, error) |
| 68 | |
| 69 | // InputHostnameFunc mocks the InputHostname method. |
| 70 | InputHostnameFunc func() (string, error) |
| 71 | |
| 72 | // MarkdownEditorFunc mocks the MarkdownEditor method. |
| 73 | MarkdownEditorFunc func(prompt string, defaultValue string, blankAllowed bool) (string, error) |
| 74 | |
| 75 | // MultiSelectFunc mocks the MultiSelect method. |
| 76 | MultiSelectFunc func(prompt string, defaults []string, options []string) ([]int, error) |
| 77 | |
| 78 | // MultiSelectWithSearchFunc mocks the MultiSelectWithSearch method. |
| 79 | MultiSelectWithSearchFunc func(prompt string, searchPrompt string, defaults []string, persistentOptions []string, searchFunc func(string) MultiSelectSearchResult) ([]string, error) |
| 80 | |
| 81 | // PasswordFunc mocks the Password method. |
| 82 | PasswordFunc func(prompt string) (string, error) |
| 83 | |
| 84 | // SelectFunc mocks the Select method. |
| 85 | SelectFunc func(prompt string, defaultValue string, options []string) (int, error) |
| 86 | |
| 87 | // calls tracks calls to the methods. |
| 88 | calls struct { |
| 89 | // AuthToken holds details about calls to the AuthToken method. |
| 90 | AuthToken []struct { |
| 91 | } |
| 92 | // Confirm holds details about calls to the Confirm method. |
| 93 | Confirm []struct { |
| 94 | // Prompt is the prompt argument value. |
| 95 | Prompt string |
| 96 | // DefaultValue is the defaultValue argument value. |
| 97 | DefaultValue bool |
| 98 | } |
| 99 | // ConfirmDeletion holds details about calls to the ConfirmDeletion method. |
| 100 | ConfirmDeletion []struct { |
| 101 | // RequiredValue is the requiredValue argument value. |
| 102 | RequiredValue string |
| 103 | } |
| 104 | // Input holds details about calls to the Input method. |
| 105 | Input []struct { |
| 106 | // Prompt is the prompt argument value. |
| 107 | Prompt string |
| 108 | // DefaultValue is the defaultValue argument value. |
| 109 | DefaultValue string |
| 110 | } |
| 111 | // InputHostname holds details about calls to the InputHostname method. |
| 112 | InputHostname []struct { |
| 113 | } |
nothing calls this directly
no outgoing calls
no test coverage detected