(t *testing.T)
| 189 | } |
| 190 | |
| 191 | func TestCreateRunResourceHost(t *testing.T) { |
| 192 | ios, _, _, _ := iostreams.Test() |
| 193 | var gotHost string |
| 194 | opts := &CreateOptions{ |
| 195 | IO: ios, |
| 196 | Config: func() (gh.Config, error) { return config.NewMockConfig(), nil }, |
| 197 | EventClient: func(host string) (client.EventClient, error) { |
| 198 | gotHost = host |
| 199 | return &client.EventClientMock{ |
| 200 | CreateSubscriptionFunc: func(context.Context, string, []string) (*client.Subscription, bool, error) { |
| 201 | return &client.Subscription{ID: "sub_1"}, true, nil |
| 202 | }, |
| 203 | }, nil |
| 204 | }, |
| 205 | Now: time.Now, |
| 206 | Resource: "https://ghe.example.com/OWNER/REPO/pull/1", |
| 207 | Events: []string{"test.a"}, |
| 208 | } |
| 209 | |
| 210 | require.NoError(t, createRun(context.Background(), opts)) |
| 211 | assert.Equal(t, "ghe.example.com", gotHost) |
| 212 | } |
nothing calls this directly
no test coverage detected