(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestGetOrDefaultExistingHostSpecificKey(t *testing.T) { |
| 104 | // Given have a host specific config entry |
| 105 | cfg := newTestConfig() |
| 106 | cfg.Set("github.com", "host-specific-key", "host-specific-value") |
| 107 | |
| 108 | // When we get that key |
| 109 | optionalEntry := cfg.GetOrDefault("github.com", "host-specific-key") |
| 110 | |
| 111 | // Then it returns a Some variant containing the correct value and a source of user |
| 112 | entry := optionalEntry.Expect("expected there to be a value") |
| 113 | require.Equal(t, "host-specific-value", entry.Value) |
| 114 | require.Equal(t, gh.ConfigUserProvided, entry.Source) |
| 115 | } |
| 116 | |
| 117 | func TestGetOrDefaultHostnameSpecificKeyFallsBackToTopLevel(t *testing.T) { |
| 118 | // Given have a top level config entry |
nothing calls this directly
no test coverage detected