diff --git a/internal/config/config_file_test.go b/internal/config/config_file_test.go index 2d7fd4b73..112221021 100644 --- a/internal/config/config_file_test.go +++ b/internal/config/config_file_test.go @@ -110,7 +110,7 @@ github.com: _, err := ParseConfig("config.yml") assert.Nil(t, err) - expectedMain := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: https\n# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.\neditor:\n# Aliases allow you to create nicknames for gh commands\naliases:\n co: pr checkout\n" + expectedMain := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: https\n# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.\neditor:\n# When to interactively prompt. This is a global config that cannot be overriden by hostname. Supported values: auto, never\nprompt: auto\n# Aliases allow you to create nicknames for gh commands\naliases:\n co: pr checkout\n" expectedHosts := `github.com: user: keiyuri oauth_token: "123456" diff --git a/internal/config/config_type_test.go b/internal/config/config_type_test.go index df33effa3..9a57e0c4a 100644 --- a/internal/config/config_type_test.go +++ b/internal/config/config_type_test.go @@ -19,7 +19,7 @@ func Test_fileConfig_Set(t *testing.T) { assert.NoError(t, c.Set("github.com", "user", "hubot")) assert.NoError(t, c.Write()) - expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: https\n# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.\neditor: nano\n# Aliases allow you to create nicknames for gh commands\naliases:\n co: pr checkout\n" + expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: https\n# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.\neditor: nano\n# When to interactively prompt. This is a global config that cannot be overriden by hostname. Supported values: auto, never\nprompt: auto\n# Aliases allow you to create nicknames for gh commands\naliases:\n co: pr checkout\n" assert.Equal(t, expected, mainBuf.String()) assert.Equal(t, `github.com: git_protocol: ssh @@ -37,7 +37,7 @@ func Test_defaultConfig(t *testing.T) { cfg := NewBlankConfig() assert.NoError(t, cfg.Write()) - expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: https\n# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.\neditor:\n# Aliases allow you to create nicknames for gh commands\naliases:\n co: pr checkout\n" + expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: https\n# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.\neditor:\n# When to interactively prompt. This is a global config that cannot be overriden by hostname. Supported values: auto, never\nprompt: auto\n# Aliases allow you to create nicknames for gh commands\naliases:\n co: pr checkout\n" assert.Equal(t, expected, mainBuf.String()) assert.Equal(t, "", hostsBuf.String())