From e66aa25fcec95e9676f7b360c8a8b46a951d5f43 Mon Sep 17 00:00:00 2001 From: Makpoc Date: Sat, 10 Oct 2015 04:15:25 +0300 Subject: [PATCH] Fail the test if the configuration fails. --- config/setup/root_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/setup/root_test.go b/config/setup/root_test.go index 7394d689..f34e05d2 100644 --- a/config/setup/root_test.go +++ b/config/setup/root_test.go @@ -13,18 +13,18 @@ func TestRoot(t *testing.T) { // Predefined error substrings parseErrContent := "Parse error:" - unableToAccessErroContent := "Unable to access root path" + unableToAccessErrContent := "Unable to access root path" existingDirPath, err := getTempDirPath() if err != nil { - t.Errorf("BeforeTest: Failed to find an existing directory for testing! Error was: %v", err) + t.Fatalf("BeforeTest: Failed to find an existing directory for testing! Error was: %v", err) } nonExistingDir := filepath.Join(existingDirPath, "highly_unlikely_to_exist_dir") existingFile, err := ioutil.TempFile("", "root_test") if err != nil { - t.Errorf("BeforeTest: Failed to create temp file for testing! Error was: %v", err) + t.Fatalf("BeforeTest: Failed to create temp file for testing! Error was: %v", err) } defer os.Remove(existingFile.Name()) @@ -48,7 +48,7 @@ func TestRoot(t *testing.T) { `root `, true, "", parseErrContent, }, { - fmt.Sprintf(`root %s`, unaccessiblePath), true, "", unableToAccessErroContent, + fmt.Sprintf(`root %s`, unaccessiblePath), true, "", unableToAccessErrContent, }, { fmt.Sprintf(`root {