INNER CODE UNIT · Go

TestRootCmd

itaysk/kubectl-neat · cmd/cmd_test.go:29

func TestRootCmd(t *testing.T) {
	resourceDataJSONPath := "../test/fixtures/service1-raw.json"
	resourceDataJSONBytes, err := ioutil.ReadFile(resourceDataJSONPath)
	resourceDataJSON := string(resourceDataJSONBytes)
	if err != nil {
		t.Errorf("error readin test data file %s: %v", resourceDataJSONPath, err)
	}
	resourceDataYAMLPath := "../test/fixtures/service1-raw.yaml"
	resourceDataYAMLBytes, err := ioutil.ReadFile(resourceDataYAMLPath)
	resourceDataYAML := string(resourceDataYAMLBytes)
	if err != nil {
		t.Errorf("error readin test data file %s: %v", resourceDataYAMLPath, err)
	}

	testcases := []struct {
		args        []string
		stdin       string
		assertError func(err error) bool

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…