Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
35 lines
774 B
Go
35 lines
774 B
Go
package xgenny_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/gobuffalo/genny/v2"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/ignite/cli/v29/ignite/pkg/xgenny"
|
|
)
|
|
|
|
func TestMultipleGen(t *testing.T) {
|
|
var (
|
|
runner = xgenny.NewRunner(context.Background(), t.TempDir())
|
|
firstGen = genny.New()
|
|
secondGen = genny.New()
|
|
firstRunCount int
|
|
secondRunCount int
|
|
)
|
|
|
|
firstGen.RunFn(func(_ *genny.Runner) error {
|
|
firstRunCount++
|
|
return nil
|
|
})
|
|
|
|
secondGen.RunFn(func(_ *genny.Runner) error {
|
|
secondRunCount++
|
|
return nil
|
|
})
|
|
|
|
require.NoError(t, runner.Run(firstGen, secondGen))
|
|
require.Equal(t, 1, firstRunCount, "first generator should run only once")
|
|
require.Equal(t, 1, secondRunCount, "second generator should run only once")
|
|
}
|