validation

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2017 License: GPL-3.0, GPL-3.0 Imports: 15 Imported by: 14

Documentation

Overview

Validation invokes language runner for every step in serial fashion with the StepValidateRequest and runner gets back with the StepValidateResponse.

Step Level validation

  1. Duplicate step implementation
  2. Step implementation not found : Prints a step implementation stub for every unimplemented step

If there is a validation error it skips that scenario and executes other scenarios in the spec.

Index

Constants

This section is empty.

Variables

View Source
var HideSuggestion bool

HideSuggestion is used decide whether suggestion should be given for the unimplemented step or not based on the flag : --hide-suggestion.

View Source
var TableRows = ""

TableRows is used to check for table rows range validation.

Functions

func Validate

func Validate(args []string)

Validate validates specs and if it has any errors, it exits.

Types

type SpecValidationError added in v0.8.0

type SpecValidationError struct {
	// contains filtered or unexported fields
}

func NewSpecValidationError added in v0.8.0

func NewSpecValidationError(m string, f string) SpecValidationError

NewSpecValidationError generates new spec validation error with error message and filename.

func (SpecValidationError) Error added in v0.8.0

func (s SpecValidationError) Error() string

Error prints a spec validation error with filename and error message.

type StepValidationError

type StepValidationError struct {
	// contains filtered or unexported fields
}

func NewStepValidationError added in v0.8.0

func NewStepValidationError(s *gauge.Step, m string, f string, e *gm.StepValidateResponse_ErrorType) StepValidationError

NewStepValidationError generates new step validation error with error message, filename and error type.

func (StepValidationError) Error

func (s StepValidationError) Error() string

Error prints a step validation error with filename, line number, error message, step text and suggestion in case of step implementation not found.

func (StepValidationError) Suggestion added in v0.9.2

func (s StepValidationError) Suggestion() string

type ValidationResult added in v0.6.2

type ValidationResult struct {
	SpecCollection *gauge.SpecCollection
	ErrMap         *gauge.BuildErrors
	Runner         runner.Runner
	Errs           []error
	ParseOk        bool
}

func NewValidationResult added in v0.6.2

func NewValidationResult(s *gauge.SpecCollection, errMap *gauge.BuildErrors, r runner.Runner, parseOk bool, e ...error) *ValidationResult

NewValidationResult creates a new Validation result

func ValidateSpecs

func ValidateSpecs(args []string, debug bool) *ValidationResult

ValidateSpecs parses the specs, creates a new validator and call the runner to get the validation result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL