(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func setupCreateConfig(t *testing.T) (*config.MainConfig, string) { |
| 12 | t.Helper() |
| 13 | tmpDir := t.TempDir() |
| 14 | configPath := tmpDir + "/.tryssh/tryssh.db" |
| 15 | knownHostsPath := tmpDir + "/.tryssh/known_hosts" |
| 16 | |
| 17 | originalConfigPath := config.DefaultConfigPath |
| 18 | originalKnownHostsPath := config.DefaultKnownHostsPath |
| 19 | config.DefaultConfigPath = configPath |
| 20 | config.DefaultKnownHostsPath = knownHostsPath |
| 21 | t.Cleanup(func() { |
| 22 | config.DefaultConfigPath = originalConfigPath |
| 23 | config.DefaultKnownHostsPath = originalKnownHostsPath |
| 24 | }) |
| 25 | |
| 26 | cfg := newTestMainConfig() |
| 27 | return cfg, configPath |
| 28 | } |
| 29 | |
| 30 | func TestNewCreateController(t *testing.T) { |
| 31 | cfg := newTestMainConfig() |
no test coverage detected