// Parse all specifications in the project and find all the steps func (specInfoGatherer *SpecInfoGatherer) findAllStepsFromSpecs() { specFiles := util.FindSpecFilesIn(filepath.Join(config.ProjectRoot, common.SpecsDirectoryName)) availableSpecs, parseResults := parser.ParseSpecFiles(specFiles, specInfoGatherer.getDictionary()) specInfoGatherer.handleParseFailures(parseResults) specInfoGatherer.addStepsForSpecs(availableSpecs) }
func getSpecFiles(specSource string) []string { specFiles := make([]string, 0) if common.DirExists(specSource) { specFiles = append(specFiles, util.FindSpecFilesIn(specSource)...) } else if common.FileExists(specSource) && util.IsValidSpecExtension(specSource) { specFile, _ := filepath.Abs(specSource) specFiles = append(specFiles, specFile) } return specFiles }
func (s *SpecInfoGatherer) initSpecsCache() { s.specsCache = make(map[string][]*parser.Specification, 0) specFiles := util.FindSpecFilesIn(filepath.Join(config.ProjectRoot, common.SpecsDirectoryName)) parsedSpecs := s.getParsedSpecs(specFiles) logger.ApiLog.Debug("Initializing specs cache with %d specs", len(parsedSpecs)) for _, spec := range parsedSpecs { s.addToSpecsCache(spec.FileName, spec) } }
func (s *MySuite) TestGetParsedSpecs(c *C) { _, err := util.CreateFileIn(s.specsDir, "spec1.spec", spec1) c.Assert(err, Equals, nil) specInfoGatherer := &SpecInfoGatherer{SpecDirs: []string{specDir}} specFiles := util.FindSpecFilesIn(s.specsDir) specs := specInfoGatherer.getParsedSpecs(specFiles) c.Assert(len(specs), Equals, 1) c.Assert(specs[0].Heading.Value, Equals, "Specification Heading") }
func (s *SpecInfoGatherer) initSpecsCache() { defer s.waitGroup.Done() s.specsCache = make(map[string][]*gauge.Specification, 0) specFiles := util.FindSpecFilesIn(filepath.Join(config.ProjectRoot, common.SpecsDirectoryName)) parsedSpecs := s.getParsedSpecs(specFiles) logger.APILog.Info("Initializing specs cache with %d specs", len(parsedSpecs)) for _, spec := range parsedSpecs { logger.APILog.Debug("Adding specs from %s", spec.FileName) s.addToSpecsCache(spec.FileName, spec) } }
func (s *SpecInfoGatherer) initSpecsCache() { defer s.waitGroup.Done() var specFiles []string s.specsCache = make(map[string][]*gauge.Specification, 0) for _, dir := range s.SpecDirs { specFiles = append(specFiles, util.FindSpecFilesIn(filepath.Join(config.ProjectRoot, dir))...) } parsedSpecs := s.getParsedSpecs(specFiles) logger.APILog.Info("Initializing specs cache with %d specs", len(parsedSpecs)) for _, spec := range parsedSpecs { logger.APILog.Debug("Adding specs from %s", spec.FileName) s.addToSpecsCache(spec.FileName, spec) } }