fixes test case location matching and bumps version

Этот коммит содержится в:
gedi 2017-03-09 19:29:51 +02:00
родитель 96efe41c4d
коммит cf8fbb4ad0
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -42,4 +42,4 @@ Godog was inspired by Behat and Cucumber the above description is taken from it'
package godog
// Version of package - based on Semantic Versioning 2.0.0 http://semver.org/
const Version = "v0.6.2"
const Version = "v0.6.3"

Просмотреть файл

@ -389,16 +389,16 @@ func (s *suiteContext) theseEventsHadToBeFiredForNumberOfTimes(tbl *gherkin.Data
}
func (s *suiteContext) theRenderJSONWillBe(docstring *gherkin.DocString) error {
loc := regexp.MustCompile(`"suite_test.go:\d+"`)
var expected []cukeFeatureJSON
if err := json.Unmarshal([]byte(docstring.Content), &expected); err != nil {
if err := json.Unmarshal([]byte(loc.ReplaceAllString(docstring.Content, `"suite_test.go:0"`)), &expected); err != nil {
return err
}
var actual []cukeFeatureJSON
re := regexp.MustCompile(`"duration":\s*\d+`)
replaced := re.ReplaceAllString(s.out.String(), `"duration": -1`)
if err := json.Unmarshal([]byte(replaced), &actual); err != nil {
if err := json.Unmarshal([]byte(loc.ReplaceAllString(replaced, `"suite_test.go:0"`)), &actual); err != nil {
return err
}