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