Documentation ¶
Index ¶
- Variables
- func NewNotAllowedAssertionMethodError(method AssertionMethod) error
- func NewNotAllowedContentTypeError(contentType ContentType) error
- func NewNotAllowedHTTPMethodError(method HTTPMethod) error
- func NewNotAllowedStageError(stage Stage) error
- func NewUndefinedDependencyError(slug Slug) error
- type Assert
- type Assertion
- type AssertionBuilder
- type AssertionMethod
- type BuildError
- type BuildErrorWrapper
- type Builder
- func (b *Builder) Build() (*Specification, error)
- func (b *Builder) ErrlessBuild() *Specification
- func (b *Builder) Reset()
- func (b *Builder) WithAuthor(author string) *Builder
- func (b *Builder) WithDescription(description string) *Builder
- func (b *Builder) WithID(id string) *Builder
- func (b *Builder) WithLoadedAt(loadedAt time.Time) *Builder
- func (b *Builder) WithOwnerID(ownerID string) *Builder
- func (b *Builder) WithStory(slug string, buildFn func(b *StoryBuilder)) *Builder
- func (b *Builder) WithTestCampaignID(testCampaignID string) *Builder
- func (b *Builder) WithTitle(title string) *Builder
- type ContentType
- type HTTP
- type HTTPBuilder
- type HTTPMethod
- type HTTPRequest
- type HTTPRequestBuilder
- func (b *HTTPRequestBuilder) Build() HTTPRequest
- func (b *HTTPRequestBuilder) Reset()
- func (b *HTTPRequestBuilder) WithBody(body map[string]interface{}) *HTTPRequestBuilder
- func (b *HTTPRequestBuilder) WithContentType(contentType ContentType) *HTTPRequestBuilder
- func (b *HTTPRequestBuilder) WithMethod(method HTTPMethod) *HTTPRequestBuilder
- func (b *HTTPRequestBuilder) WithURL(url string) *HTTPRequestBuilder
- type HTTPResponse
- type HTTPResponseBuilder
- type NotAllowedAssertionMethodError
- type NotAllowedContentTypeError
- type NotAllowedHTTPMethodError
- type NotAllowedStageError
- type Scenario
- type ScenarioBuilder
- type Slug
- func (s Slug) IsZero() bool
- func (s Slug) Kind() SlugKind
- func (s Slug) Partial() string
- func (s Slug) Scenario() string
- func (s Slug) ShouldBeScenarioKind() error
- func (s Slug) ShouldBeStoryKind() error
- func (s Slug) ShouldBeThesisKind() error
- func (s Slug) Story() string
- func (s Slug) String() string
- func (s Slug) Thesis() string
- func (s Slug) ToScenarioKind() Slug
- func (s Slug) ToStoryKind() Slug
- func (s Slug) ToThesisKind() Slug
- type SlugKind
- type Specification
- func (s *Specification) Author() string
- func (s *Specification) Description() string
- func (s *Specification) ID() string
- func (s *Specification) LoadedAt() time.Time
- func (s *Specification) OwnerID() string
- func (s *Specification) Scenarios() []Scenario
- func (s *Specification) ScenariosCount() int
- func (s *Specification) Stories() []Story
- func (s *Specification) StoriesCount() int
- func (s *Specification) Story(slug string) (story Story, ok bool)
- func (s *Specification) TestCampaignID() string
- func (s *Specification) Theses() []Thesis
- func (s *Specification) ThesesCount() int
- func (s *Specification) Title() string
- type Stage
- type Story
- type StoryBuilder
- func (b *StoryBuilder) Build(slug Slug) Story
- func (b *StoryBuilder) Reset()
- func (b *StoryBuilder) WithAsA(asA string) *StoryBuilder
- func (b *StoryBuilder) WithDescription(description string) *StoryBuilder
- func (b *StoryBuilder) WithInOrderTo(inOrderTo string) *StoryBuilder
- func (b *StoryBuilder) WithScenario(slug string, buildFn func(b *ScenarioBuilder)) *StoryBuilder
- func (b *StoryBuilder) WithWantTo(wantTo string) *StoryBuilder
- type Thesis
- type ThesisBuilder
- func (b *ThesisBuilder) Build(slug Slug) Thesis
- func (b *ThesisBuilder) Reset()
- func (b *ThesisBuilder) WithAssertion(buildFn func(b *AssertionBuilder)) *ThesisBuilder
- func (b *ThesisBuilder) WithDependency(dep string) *ThesisBuilder
- func (b *ThesisBuilder) WithHTTP(buildFn func(b *HTTPBuilder)) *ThesisBuilder
- func (b *ThesisBuilder) WithStatement(stage Stage, behavior string) *ThesisBuilder
- type UndefinedDependencyError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotStorySlug = errors.New("not story slug") ErrNotScenarioSlug = errors.New("not scenario slug") ErrNotThesisSlug = errors.New("not thesis slug") )
View Source
var ErrNoHTTPRequest = errors.New("no request")
View Source
var ErrNoScenarioTheses = errors.New("no theses")
View Source
var ErrNoSpecificationStories = errors.New("no stories")
View Source
var ErrNoStoryScenarios = errors.New("no scenarios")
View Source
var ErrUselessThesis = errors.New("useless thesis")
Functions ¶
func NewNotAllowedAssertionMethodError ¶
func NewNotAllowedAssertionMethodError(method AssertionMethod) error
func NewNotAllowedContentTypeError ¶
func NewNotAllowedContentTypeError(contentType ContentType) error
func NewNotAllowedHTTPMethodError ¶
func NewNotAllowedHTTPMethodError(method HTTPMethod) error
func NewNotAllowedStageError ¶
Types ¶
type Assertion ¶
type Assertion struct {
// contains filtered or unexported fields
}
func (Assertion) Method ¶
func (a Assertion) Method() AssertionMethod
type AssertionBuilder ¶
type AssertionBuilder struct {
// contains filtered or unexported fields
}
func (*AssertionBuilder) Build ¶
func (b *AssertionBuilder) Build() Assertion
func (*AssertionBuilder) Reset ¶
func (b *AssertionBuilder) Reset()
func (*AssertionBuilder) WithAssert ¶
func (b *AssertionBuilder) WithAssert(actual string, expected interface{}) *AssertionBuilder
func (*AssertionBuilder) WithMethod ¶
func (b *AssertionBuilder) WithMethod(method AssertionMethod) *AssertionBuilder
type AssertionMethod ¶
type AssertionMethod string
const ( UnknownAssertionMethod AssertionMethod = "!" NoAssertionMethod AssertionMethod = "" JSONPath AssertionMethod = "jsonpath" )
func (AssertionMethod) IsValid ¶
func (am AssertionMethod) IsValid() bool
func (AssertionMethod) String ¶
func (am AssertionMethod) String() string
type BuildError ¶
type BuildError struct {
// contains filtered or unexported fields
}
func (*BuildError) As ¶
func (e *BuildError) As(target interface{}) bool
func (*BuildError) Error ¶
func (e *BuildError) Error() string
func (*BuildError) Errors ¶
func (e *BuildError) Errors() []error
func (*BuildError) Is ¶
func (e *BuildError) Is(target error) bool
func (*BuildError) SlugContext ¶
func (e *BuildError) SlugContext() (Slug, bool)
func (*BuildError) StringContext ¶
func (e *BuildError) StringContext() (string, bool)
type BuildErrorWrapper ¶
type BuildErrorWrapper struct {
// contains filtered or unexported fields
}
func (*BuildErrorWrapper) SluggedWrap ¶
func (w *BuildErrorWrapper) SluggedWrap(slug Slug) error
func (*BuildErrorWrapper) WithError ¶
func (w *BuildErrorWrapper) WithError(err error) *BuildErrorWrapper
func (*BuildErrorWrapper) Wrap ¶
func (w *BuildErrorWrapper) Wrap(ctxMsg string) error
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) Build ¶
func (b *Builder) Build() (*Specification, error)
func (*Builder) ErrlessBuild ¶
func (b *Builder) ErrlessBuild() *Specification
func (*Builder) WithAuthor ¶
func (*Builder) WithDescription ¶
func (*Builder) WithOwnerID ¶
func (*Builder) WithStory ¶
func (b *Builder) WithStory(slug string, buildFn func(b *StoryBuilder)) *Builder
func (*Builder) WithTestCampaignID ¶
type ContentType ¶
type ContentType string
const ( UnknownContentType ContentType = "!" NoContentType ContentType = "" ApplicationJSON ContentType = "application/json" ApplicationXML ContentType = "application/xml" )
func (ContentType) IsValid ¶
func (ct ContentType) IsValid() bool
func (ContentType) String ¶
func (ct ContentType) String() string
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
func (HTTP) Request ¶
func (h HTTP) Request() HTTPRequest
func (HTTP) Response ¶
func (h HTTP) Response() HTTPResponse
type HTTPBuilder ¶
type HTTPBuilder struct {
// contains filtered or unexported fields
}
func (*HTTPBuilder) Build ¶
func (b *HTTPBuilder) Build() HTTP
func (*HTTPBuilder) Reset ¶
func (b *HTTPBuilder) Reset()
func (*HTTPBuilder) WithRequest ¶
func (b *HTTPBuilder) WithRequest(buildFn func(b *HTTPRequestBuilder)) *HTTPBuilder
func (*HTTPBuilder) WithResponse ¶
func (b *HTTPBuilder) WithResponse(buildFn func(b *HTTPResponseBuilder)) *HTTPBuilder
type HTTPMethod ¶
type HTTPMethod string
const ( UnknownHTTPMethod HTTPMethod = "!" NoHTTPMethod HTTPMethod = "" GET HTTPMethod = "GET" POST HTTPMethod = "POST" PUT HTTPMethod = "PUT" PATCH HTTPMethod = "PATCH" DELETE HTTPMethod = "DELETE" OPTIONS HTTPMethod = "OPTIONS" TRACE HTTPMethod = "TRACE" CONNECT HTTPMethod = "CONNECT" HEAD HTTPMethod = "HEAD" )
func (HTTPMethod) IsValid ¶
func (m HTTPMethod) IsValid() bool
func (HTTPMethod) String ¶
func (m HTTPMethod) String() string
type HTTPRequest ¶
type HTTPRequest struct {
// contains filtered or unexported fields
}
func (HTTPRequest) Body ¶
func (r HTTPRequest) Body() map[string]interface{}
func (HTTPRequest) ContentType ¶
func (r HTTPRequest) ContentType() ContentType
func (HTTPRequest) IsZero ¶
func (r HTTPRequest) IsZero() bool
func (HTTPRequest) Method ¶
func (r HTTPRequest) Method() HTTPMethod
func (HTTPRequest) URL ¶
func (r HTTPRequest) URL() string
type HTTPRequestBuilder ¶
type HTTPRequestBuilder struct {
// contains filtered or unexported fields
}
func (*HTTPRequestBuilder) Build ¶
func (b *HTTPRequestBuilder) Build() HTTPRequest
func (*HTTPRequestBuilder) Reset ¶
func (b *HTTPRequestBuilder) Reset()
func (*HTTPRequestBuilder) WithBody ¶
func (b *HTTPRequestBuilder) WithBody(body map[string]interface{}) *HTTPRequestBuilder
func (*HTTPRequestBuilder) WithContentType ¶
func (b *HTTPRequestBuilder) WithContentType(contentType ContentType) *HTTPRequestBuilder
func (*HTTPRequestBuilder) WithMethod ¶
func (b *HTTPRequestBuilder) WithMethod(method HTTPMethod) *HTTPRequestBuilder
func (*HTTPRequestBuilder) WithURL ¶
func (b *HTTPRequestBuilder) WithURL(url string) *HTTPRequestBuilder
type HTTPResponse ¶
type HTTPResponse struct {
// contains filtered or unexported fields
}
func (HTTPResponse) AllowedCodes ¶
func (r HTTPResponse) AllowedCodes() []int
func (HTTPResponse) AllowedContentType ¶
func (r HTTPResponse) AllowedContentType() ContentType
func (HTTPResponse) IsZero ¶
func (r HTTPResponse) IsZero() bool
type HTTPResponseBuilder ¶
type HTTPResponseBuilder struct {
// contains filtered or unexported fields
}
func (*HTTPResponseBuilder) Build ¶
func (b *HTTPResponseBuilder) Build() HTTPResponse
func (*HTTPResponseBuilder) Reset ¶
func (b *HTTPResponseBuilder) Reset()
func (*HTTPResponseBuilder) WithAllowedCodes ¶
func (b *HTTPResponseBuilder) WithAllowedCodes(allowedCodes []int) *HTTPResponseBuilder
func (*HTTPResponseBuilder) WithAllowedContentType ¶
func (b *HTTPResponseBuilder) WithAllowedContentType( allowedContentType ContentType, ) *HTTPResponseBuilder
type NotAllowedAssertionMethodError ¶
type NotAllowedAssertionMethodError struct {
// contains filtered or unexported fields
}
func (*NotAllowedAssertionMethodError) Error ¶
func (e *NotAllowedAssertionMethodError) Error() string
func (*NotAllowedAssertionMethodError) Method ¶
func (e *NotAllowedAssertionMethodError) Method() AssertionMethod
type NotAllowedContentTypeError ¶
type NotAllowedContentTypeError struct {
// contains filtered or unexported fields
}
func (*NotAllowedContentTypeError) ContentType ¶
func (e *NotAllowedContentTypeError) ContentType() ContentType
func (*NotAllowedContentTypeError) Error ¶
func (e *NotAllowedContentTypeError) Error() string
type NotAllowedHTTPMethodError ¶
type NotAllowedHTTPMethodError struct {
// contains filtered or unexported fields
}
func (*NotAllowedHTTPMethodError) Error ¶
func (e *NotAllowedHTTPMethodError) Error() string
func (*NotAllowedHTTPMethodError) Method ¶
func (e *NotAllowedHTTPMethodError) Method() HTTPMethod
type NotAllowedStageError ¶
type NotAllowedStageError struct {
// contains filtered or unexported fields
}
func (*NotAllowedStageError) Error ¶
func (e *NotAllowedStageError) Error() string
func (*NotAllowedStageError) Stage ¶
func (e *NotAllowedStageError) Stage() Stage
type Scenario ¶
type Scenario struct {
// contains filtered or unexported fields
}
func (Scenario) Description ¶
func (Scenario) ThesesByStages ¶
type ScenarioBuilder ¶
type ScenarioBuilder struct {
// contains filtered or unexported fields
}
func (*ScenarioBuilder) Build ¶
func (b *ScenarioBuilder) Build(slug Slug) Scenario
func (*ScenarioBuilder) Reset ¶
func (b *ScenarioBuilder) Reset()
func (*ScenarioBuilder) WithDescription ¶
func (b *ScenarioBuilder) WithDescription(description string) *ScenarioBuilder
func (*ScenarioBuilder) WithThesis ¶
func (b *ScenarioBuilder) WithThesis(slug string, buildFn func(b *ThesisBuilder)) *ScenarioBuilder
type Slug ¶
type Slug struct {
// contains filtered or unexported fields
}
func NewScenarioSlug ¶
func NewStorySlug ¶
func NewThesisSlug ¶
func (Slug) Partial ¶
Partial returns a Kind part of the Slug. If Slug is zero, return an empty string.
func (Slug) ShouldBeScenarioKind ¶
func (Slug) ShouldBeStoryKind ¶
func (Slug) ShouldBeThesisKind ¶
func (Slug) ToScenarioKind ¶
func (Slug) ToStoryKind ¶
func (Slug) ToThesisKind ¶
type Specification ¶
type Specification struct {
// contains filtered or unexported fields
}
func (*Specification) Author ¶
func (s *Specification) Author() string
func (*Specification) Description ¶
func (s *Specification) Description() string
func (*Specification) ID ¶
func (s *Specification) ID() string
func (*Specification) LoadedAt ¶
func (s *Specification) LoadedAt() time.Time
func (*Specification) OwnerID ¶
func (s *Specification) OwnerID() string
func (*Specification) Scenarios ¶
func (s *Specification) Scenarios() []Scenario
func (*Specification) ScenariosCount ¶
func (s *Specification) ScenariosCount() int
func (*Specification) Stories ¶
func (s *Specification) Stories() []Story
func (*Specification) StoriesCount ¶
func (s *Specification) StoriesCount() int
func (*Specification) TestCampaignID ¶
func (s *Specification) TestCampaignID() string
func (*Specification) Theses ¶
func (s *Specification) Theses() []Thesis
func (*Specification) ThesesCount ¶
func (s *Specification) ThesesCount() int
func (*Specification) Title ¶
func (s *Specification) Title() string
type Story ¶
type Story struct {
// contains filtered or unexported fields
}
func (Story) Description ¶
type StoryBuilder ¶
type StoryBuilder struct {
// contains filtered or unexported fields
}
func (*StoryBuilder) Build ¶
func (b *StoryBuilder) Build(slug Slug) Story
func (*StoryBuilder) Reset ¶
func (b *StoryBuilder) Reset()
func (*StoryBuilder) WithAsA ¶
func (b *StoryBuilder) WithAsA(asA string) *StoryBuilder
func (*StoryBuilder) WithDescription ¶
func (b *StoryBuilder) WithDescription(description string) *StoryBuilder
func (*StoryBuilder) WithInOrderTo ¶
func (b *StoryBuilder) WithInOrderTo(inOrderTo string) *StoryBuilder
func (*StoryBuilder) WithScenario ¶
func (b *StoryBuilder) WithScenario(slug string, buildFn func(b *ScenarioBuilder)) *StoryBuilder
func (*StoryBuilder) WithWantTo ¶
func (b *StoryBuilder) WithWantTo(wantTo string) *StoryBuilder
type Thesis ¶
type Thesis struct {
// contains filtered or unexported fields
}
func (Thesis) Dependencies ¶
type ThesisBuilder ¶
type ThesisBuilder struct {
// contains filtered or unexported fields
}
func (*ThesisBuilder) Build ¶
func (b *ThesisBuilder) Build(slug Slug) Thesis
func (*ThesisBuilder) Reset ¶
func (b *ThesisBuilder) Reset()
func (*ThesisBuilder) WithAssertion ¶
func (b *ThesisBuilder) WithAssertion(buildFn func(b *AssertionBuilder)) *ThesisBuilder
func (*ThesisBuilder) WithDependency ¶
func (b *ThesisBuilder) WithDependency(dep string) *ThesisBuilder
func (*ThesisBuilder) WithHTTP ¶
func (b *ThesisBuilder) WithHTTP(buildFn func(b *HTTPBuilder)) *ThesisBuilder
func (*ThesisBuilder) WithStatement ¶
func (b *ThesisBuilder) WithStatement(stage Stage, behavior string) *ThesisBuilder
type UndefinedDependencyError ¶
type UndefinedDependencyError struct {
// contains filtered or unexported fields
}
func (*UndefinedDependencyError) Error ¶
func (e *UndefinedDependencyError) Error() string
func (*UndefinedDependencyError) Slug ¶
func (e *UndefinedDependencyError) Slug() Slug
Click to show internal directories.
Click to hide internal directories.