We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b9924b commit 22f0df8Copy full SHA for 22f0df8
internal/envutil/github_test.go
@@ -84,4 +84,14 @@ func TestLookupGitHubAPIURL(t *testing.T) {
84
t.Setenv("GITHUB_API_URL", "https://github.example.com/api/v3/")
85
assert.Equal(t, "https://github.example.com/api/v3", LookupGitHubAPIURL(defaultURL))
86
})
87
+
88
+ t.Run("returns default for whitespace-only env", func(t *testing.T) {
89
+ t.Setenv("GITHUB_API_URL", " ")
90
+ assert.Equal(t, defaultURL, LookupGitHubAPIURL(defaultURL))
91
+ })
92
93
+ t.Run("trims whitespace before stripping trailing slash", func(t *testing.T) {
94
+ t.Setenv("GITHUB_API_URL", " https://github.example.com/api/v3/ ")
95
+ assert.Equal(t, "https://github.example.com/api/v3", LookupGitHubAPIURL(defaultURL))
96
97
}
0 commit comments