closes #86
Этот коммит содержится в:
родитель
b4a371731c
коммит
b10470da31
2 изменённых файлов: 27 добавлений и 1 удалений
|
@ -118,3 +118,29 @@ Feature: undefined step snippets
|
||||||
s.Step(`^I add the "([^"]*)" to the basket$`, iAddTheToTheBasket)
|
s.Step(`^I add the "([^"]*)" to the basket$`, iAddTheToTheBasket)
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Scenario: should handle arguments in the beggining or end of the step
|
||||||
|
Given a feature "undefined.feature" file:
|
||||||
|
"""
|
||||||
|
Feature: undefined
|
||||||
|
|
||||||
|
Scenario: add item to basket
|
||||||
|
Given "Sith Lord Lightsaber", which costs £5
|
||||||
|
And 12 godogs
|
||||||
|
"""
|
||||||
|
When I run feature suite
|
||||||
|
And the undefined step snippets should be:
|
||||||
|
"""
|
||||||
|
func whichCosts(arg1 string, arg2 int) error {
|
||||||
|
return godog.ErrPending
|
||||||
|
}
|
||||||
|
|
||||||
|
func godogs(arg1 int) error {
|
||||||
|
return godog.ErrPending
|
||||||
|
}
|
||||||
|
|
||||||
|
func FeatureContext(s *godog.Suite) {
|
||||||
|
s.Step(`^"([^"]*)", which costs £(\d+)$`, whichCosts)
|
||||||
|
s.Step(`^(\d+) godogs$`, godogs)
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
2
fmt.go
2
fmt.go
|
@ -403,7 +403,7 @@ func (f *basefmt) snippets() string {
|
||||||
|
|
||||||
name := snippetNumbers.ReplaceAllString(step, " ")
|
name := snippetNumbers.ReplaceAllString(step, " ")
|
||||||
name = snippetExprQuoted.ReplaceAllString(name, " ")
|
name = snippetExprQuoted.ReplaceAllString(name, " ")
|
||||||
name = snippetMethodName.ReplaceAllString(name, "")
|
name = strings.TrimSpace(snippetMethodName.ReplaceAllString(name, ""))
|
||||||
var words []string
|
var words []string
|
||||||
for i, w := range strings.Split(name, " ") {
|
for i, w := range strings.Split(name, " ") {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче