Documentation
¶
Index ¶
- func AssertBoolPtr(t *testing.T, got *bool, wantNil bool, wantVal bool, field string)
- func AssertStringPtr(t *testing.T, got *string, wantNil bool, wantVal string, field string)
- func CreateFile(t *testing.T, dir, name string)
- func NewTestClient(t *testing.T, server *httptest.Server) *api.RESTClient
- func WriteConfig(t *testing.T, dir, content string)
- type TestTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertBoolPtr ¶
AssertBoolPtr checks a *bool field. When wantNil is true, it expects got to be nil. Otherwise it expects got to be non-nil with value wantVal.
func AssertStringPtr ¶
AssertStringPtr checks a *string field. When wantNil is true, it expects got to be nil. Otherwise it expects got to be non-nil with value wantVal.
func CreateFile ¶
CreateFile creates a file at filepath.Join(dir, name) with dummy content. Parent directories are created as needed.
func NewTestClient ¶
NewTestClient creates an api.RESTClient that sends all requests to the given test server.
func WriteConfig ¶
WriteConfig writes a .tailor.yml file in dir with the given content.
Types ¶
type TestTransport ¶
TestTransport redirects all requests to the test server, preserving the original request path so the test handler can route by path.