55 строки
1,4 КиБ
Go
55 строки
1,4 КиБ
Go
package accuracy
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
|
|
"my/schet/pkg/testlib"
|
|
|
|
"github.com/cucumber/godog"
|
|
"github.com/cucumber/godog/colors"
|
|
|
|
. "github.com/onsi/gomega"
|
|
gomega_format "github.com/onsi/gomega/format"
|
|
)
|
|
|
|
func InitializeScenario(ctx *godog.ScenarioContext) {
|
|
ctx.Step(`^RoundTemp возвращает округлённое$`, roundTempВозвращаетОкруглённое)
|
|
ctx.Step(`^RoundDist возвращает округлённое$`, roundDistВозвращаетОкруглённое)
|
|
|
|
// -----------------------
|
|
ctx.Before(func(ctx context.Context, sc *godog.Scenario) (context.Context, error) {
|
|
beforeScenario()
|
|
return ctx, nil
|
|
})
|
|
ctx.After(func(ctx context.Context, sc *godog.Scenario, err error) (context.Context, error) {
|
|
afterScenario()
|
|
return ctx, nil
|
|
})
|
|
testlib.InitializeGomegaForGodog(ctx)
|
|
gomega_format.CharactersAroundMismatchToInclude = 50
|
|
_ = Ω
|
|
}
|
|
|
|
func InitializeSuite(tsc *godog.TestSuiteContext) {
|
|
tsc.BeforeSuite(beforeSuite)
|
|
tsc.AfterSuite(afterSuite)
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
var opts = godog.Options{
|
|
Output: colors.Colored(os.Stdout),
|
|
Strict: true,
|
|
StopOnFailure: true,
|
|
}
|
|
|
|
godog.BindCommandLineFlags("godog.", &opts)
|
|
r := godog.TestSuite{
|
|
Name: "app",
|
|
TestSuiteInitializer: InitializeSuite,
|
|
ScenarioInitializer: InitializeScenario,
|
|
Options: &opts,
|
|
}.Run()
|
|
os.Exit(r)
|
|
}
|