package examples_test

import (
	"flag"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	. "github.com/pingcap/endless/pkg/util"
)

// Run this test as the following so that this test will fail
// `ginkgo -focus "#Endless_ParameterizedDescribe_01#" -- ParametrizationDescribe --arg1 1 --arg2 2`
var _ = ParameterizedDescribe("ParameterizedDescribe", func(flags *flag.FlagSet) {
	const failed = "test failed"

	var (
		test  string
		test2 string
	)

	flags.StringVar(&test, "arg1", failed, "string arg1.")
	flags.StringVar(&test2, "arg2", failed, "string arg2.")

	Context("when parsing parameters", func() {
		TestCase("with correct input", "Endless_ParameterizedDescribe_01", func() {
			Expect(test).Should(Equal(failed))
			Expect(test).Should(Equal(failed))
		})
	})
})
