From 4a62479892273dab4b19c1332809c5b9932ddf79 Mon Sep 17 00:00:00 2001 From: gedi Date: Wed, 15 Jun 2016 15:54:34 +0300 Subject: [PATCH] fix feature path assertion for windows os --- suite_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/suite_test.go b/suite_test.go index 4f0edc0..80e3543 100644 --- a/suite_test.go +++ b/suite_test.go @@ -2,6 +2,7 @@ package godog import ( "fmt" + "path/filepath" "strconv" "strings" @@ -215,8 +216,12 @@ func (s *suiteContext) iShouldHaveNumFeatureFiles(num int, files *gherkin.DocStr return fmt.Errorf("expected %d feature paths to be parsed, but have %d", len(expected), len(actual)) } for i := 0; i < len(expected); i++ { - if expected[i] != actual[i] { - return fmt.Errorf(`expected feature path "%s" at position: %d, does not match actual "%s"`, expected[i], i, actual[i]) + split := strings.Split(expected[i], "/") + exp := filepath.Join(split...) + split = strings.Split(actual[i], "/") + act := filepath.Join(split...) + if exp != act { + return fmt.Errorf(`expected feature path "%s" at position: %d, does not match actual "%s"`, exp, i, act) } } return nil