arnaucube
arnaucube/mirror-to-giteaPublic Self-hosted repository
mirror-to-gitea/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.go
vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.goRaw
 1package leafnodes
 2
 3import (
 4	"time"
 5
 6	"github.com/onsi/ginkgo/internal/failer"
 7	"github.com/onsi/ginkgo/types"
 8)
 9
10type ItNode struct {
11	runner *runner
12
13	flag types.FlagType
14	text string
15}
16
17func NewItNode(text string, body interface{}, flag types.FlagType, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *ItNode {
18	return &ItNode{
19		runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeIt, componentIndex),
20		flag:   flag,
21		text:   text,
22	}
23}
24
25func (node *ItNode) Run() (outcome types.SpecState, failure types.SpecFailure) {
26	return node.runner.run()
27}
28
29func (node *ItNode) Type() types.SpecComponentType {
30	return types.SpecComponentTypeIt
31}
32
33func (node *ItNode) Text() string {
34	return node.text
35}
36
37func (node *ItNode) Flag() types.FlagType {
38	return node.flag
39}
40
41func (node *ItNode) CodeLocation() types.CodeLocation {
42	return node.runner.codeLocation
43}
44
45func (node *ItNode) Samples() int {
46	return 1
47}