MCPcopy Index your code
hub / github.com/ddworken/hishtory / TestInstallSkipConfigModification

Function TestInstallSkipConfigModification

client/integration_test.go:3319–3342  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3317}
3318
3319func TestInstallSkipConfigModification(t *testing.T) {
3320 markTestForSharding(t, 14)
3321 defer testutils.BackupAndRestore(t)()
3322 tester := zshTester{}
3323
3324 // Install and check that it gave info on how to configure the shell
3325 out := tester.RunInteractiveShell(t, ` /tmp/client install --skip-config-modification | grep -v "secret hishtory key"`)
3326 testutils.CompareGoldens(t, out, "TestInstallSkipConfigModification-InstallOutput-"+runtime.GOOS)
3327
3328 // Check that the shell config files weren't configured
3329 homedir, err := os.UserHomeDir()
3330 require.NoError(t, err)
3331 shellConfigFiles := []string{
3332 path.Join(homedir, ".zshrc"),
3333 path.Join(homedir, ".bashrc"),
3334 path.Join(homedir, ".bash_profile"),
3335 path.Join(homedir, ".config/fish/config.fish"),
3336 }
3337 for _, file := range shellConfigFiles {
3338 fileContents, err := os.ReadFile(file)
3339 require.NoError(t, err)
3340 require.NotContains(t, fileContents, "hishtory")
3341 }
3342}
3343
3344func TestConfigLogLevel(t *testing.T) {
3345 markTestForSharding(t, 16)

Callers

nothing calls this directly

Calls 4

RunInteractiveShellMethod · 0.95
BackupAndRestoreFunction · 0.92
CompareGoldensFunction · 0.92
markTestForShardingFunction · 0.85

Tested by

no test coverage detected