(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestFileConfig(t *testing.T) { |
| 32 | filePath := "./test_config" |
| 33 | // define a variable to test upon |
| 34 | config := DefaultConfig() |
| 35 | // write to file |
| 36 | require.NoError(t, config.WriteToFile(filePath)) |
| 37 | defer os.RemoveAll(filePath) |
| 38 | // read from file |
| 39 | got, err := NewConfigFromFile(filePath) |
| 40 | require.NoError(t, err) |
| 41 | // compare got vs expected |
| 42 | require.Equal(t, config, got) |
| 43 | } |
nothing calls this directly
no test coverage detected