fix handling of redirect from asset download
This commit is contained in:
22
vendor/github.com/onsi/ginkgo/internal/spec/specs.go
generated
vendored
22
vendor/github.com/onsi/ginkgo/internal/spec/specs.go
generated
vendored
@@ -10,6 +10,7 @@ type Specs struct {
|
||||
specs []*Spec
|
||||
numberOfOriginalSpecs int
|
||||
hasProgrammaticFocus bool
|
||||
RegexScansFilePath bool
|
||||
}
|
||||
|
||||
func NewSpecs(specs []*Spec) *Specs {
|
||||
@@ -45,7 +46,7 @@ func (e *Specs) ApplyFocus(description string, focusString string, skipString st
|
||||
if focusString == "" && skipString == "" {
|
||||
e.applyProgrammaticFocus()
|
||||
} else {
|
||||
e.applyRegExpFocus(description, focusString, skipString)
|
||||
e.applyRegExpFocusAndSkip(description, focusString, skipString)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,12 +68,27 @@ func (e *Specs) applyProgrammaticFocus() {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Specs) applyRegExpFocus(description string, focusString string, skipString string) {
|
||||
// toMatch returns a byte[] to be used by regex matchers. When adding new behaviours to the matching function,
|
||||
// this is the place which we append to.
|
||||
func (e *Specs) toMatch(description string, spec *Spec) []byte {
|
||||
if e.RegexScansFilePath {
|
||||
return []byte(
|
||||
description + " " +
|
||||
spec.ConcatenatedString() + " " +
|
||||
spec.subject.CodeLocation().FileName)
|
||||
} else {
|
||||
return []byte(
|
||||
description + " " +
|
||||
spec.ConcatenatedString())
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Specs) applyRegExpFocusAndSkip(description string, focusString string, skipString string) {
|
||||
for _, spec := range e.specs {
|
||||
matchesFocus := true
|
||||
matchesSkip := false
|
||||
|
||||
toMatch := []byte(description + " " + spec.ConcatenatedString())
|
||||
toMatch := e.toMatch(description, spec)
|
||||
|
||||
if focusString != "" {
|
||||
focusFilter := regexp.MustCompile(focusString)
|
||||
|
2
vendor/github.com/onsi/ginkgo/internal/suite/suite.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/internal/suite/suite.go
generated
vendored
@@ -71,6 +71,7 @@ func (suite *Suite) generateSpecs(description string, config config.GinkgoConfig
|
||||
}
|
||||
|
||||
specs := spec.NewSpecs(specsSlice)
|
||||
specs.RegexScansFilePath = config.RegexScansFilePath
|
||||
|
||||
if config.RandomizeAllSpecs {
|
||||
specs.Shuffle(rand.New(rand.NewSource(config.RandomSeed)))
|
||||
@@ -85,7 +86,6 @@ func (suite *Suite) generateSpecs(description string, config config.GinkgoConfig
|
||||
if config.ParallelTotal > 1 {
|
||||
specs.TrimForParallelization(config.ParallelTotal, config.ParallelNode)
|
||||
}
|
||||
|
||||
return specs
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user