From eb165952fc0372ffc3f92430c79fbf7f827a41df Mon Sep 17 00:00:00 2001 From: Softonik Date: Mon, 17 Jun 2024 14:18:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=B3=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D1=80=D1=91=D0=BD=D0=BD=D1=8B=D1=85=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20-=20=D1=81=D0=BE=20=D1=81?= =?UTF-8?q?=D0=BA=D0=BE=D0=B1=D0=BA=D0=B0=D0=BC=D0=B8=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B7=D0=BD=D1=8B=D1=85=20=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BA=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/snippets.feature | 42 ++++++++++++------- internal/formatters/undefined_snippets_gen.go | 3 +- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/features/snippets.feature b/features/snippets.feature index 2188c55..4e7a6a7 100644 --- a/features/snippets.feature +++ b/features/snippets.feature @@ -24,8 +24,10 @@ Feature: undefined step snippets // --- - func iSendRequestTo(arg1, arg2 string) { } - func theResponseCodeShouldBe(arg1 int) { } + func iSendRequestTo(arg1, arg2 string) { + } + func theResponseCodeShouldBe(arg1 int) { + } ctx.Step(`^I send "([^"]*)" request to "([^"]*)"$`, iSendRequestTo) ctx.Step(`^the response code should be (\d+)$`, theResponseCodeShouldBe) @@ -53,9 +55,12 @@ Feature: undefined step snippets // --- - func iSendRequestToWith(arg1, arg2 string, arg3 *godog.Table) { } - func theResponseCodeShouldBeAndHeaderShouldBe(arg1 int, arg2, arg3 string) { } - func theResponseBodyShouldBe(arg1 *godog.DocString) { } + func iSendRequestToWith(arg1, arg2 string, arg3 *godog.Table) { + } + func theResponseCodeShouldBeAndHeaderShouldBe(arg1 int, arg2, arg3 string) { + } + func theResponseBodyShouldBe(arg1 *godog.DocString) { + } ctx.Step(`^I send "([^"]*)" request to "([^"]*)" with:$`, iSendRequestToWith) ctx.Step(`^the response code should be (\d+) and header "([^"]*)" should be "([^"]*)"$`, theResponseCodeShouldBeAndHeaderShouldBe) @@ -83,8 +88,10 @@ Feature: undefined step snippets // --- - func iPullFromGithubcom() { } - func theProjectShouldBeThere() { } + func iPullFromGithubcom() { + } + func theProjectShouldBeThere() { + } ctx.Step(`^I pull from github\.com$`, iPullFromGithubcom) ctx.Step(`^the project should be there$`, theProjectShouldBeThere) @@ -106,8 +113,10 @@ Feature: undefined step snippets // --- - func thereIsAWhichCosts(arg1 string, arg2 int) { } - func iAddTheToTheBasket(arg1 string) { } + func thereIsAWhichCosts(arg1 string, arg2 int) { + } + func iAddTheToTheBasket(arg1 string) { + } ctx.Step(`^there is a "([^"]*)", which costs £(\d+)$`, thereIsAWhichCosts) ctx.Step(`^I add the "([^"]*)" to the basket$`, iAddTheToTheBasket) @@ -129,8 +138,10 @@ Feature: undefined step snippets // --- - func whichCosts(arg1 string, arg2 int) { } - func godogs(arg1 int) { } + func whichCosts(arg1 string, arg2 int) { + } + func godogs(arg1 int) { + } ctx.Step(`^"([^"]*)", which costs £(\d+)$`, whichCosts) ctx.Step(`^(\d+) godogs$`, godogs) @@ -164,9 +175,12 @@ Feature: undefined step snippets // --- - func чтото() { } - func яДелаюЕщёЧтотоParam(param1 string, arg1, arg2 int, param2, параметр3, arg3, data string) { } - func получаетсяЕщёБолееЧтото() { } + func чтото() { + } + func яДелаюЕщёЧтотоParam(param1 string, arg1, arg2 int, param2, параметр3, arg3, data string) { + } + func получаетсяЕщёБолееЧтото() { + } ctx.Step(`^что-то$`, чтото) ctx.Step(`^я делаю ещё что-то "([^"]*)", (\d+), (\d+), param="([^"]*)", "([^"]*)", "([^"]*)", "([^"]*)"$`, яДелаюЕщёЧтотоParam) diff --git a/internal/formatters/undefined_snippets_gen.go b/internal/formatters/undefined_snippets_gen.go index c3ea9d9..58b29a8 100644 --- a/internal/formatters/undefined_snippets_gen.go +++ b/internal/formatters/undefined_snippets_gen.go @@ -28,7 +28,8 @@ var undefinedSnippetsTpl = template.Must(template.New("snippets").Funcs(snippetH // --- -{{ range . }}func {{ .Method }}({{ .Args }}) { } +{{ range . }}func {{ .Method }}({{ .Args }}) { +} {{end}}{{ range . }} ctx.Step({{ backticked .Expr }}, {{ .Method }}){{end}} `))