(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func TestGetOrDefaultExistingTopLevelKey(t *testing.T) { |
| 90 | // Given have a top level config entry |
| 91 | cfg := newTestConfig() |
| 92 | cfg.Set("", "top-level-key", "top-level-value") |
| 93 | |
| 94 | // When we get that key |
| 95 | optionalEntry := cfg.GetOrDefault("non-existent-host", "top-level-key") |
| 96 | |
| 97 | // Then it returns a Some variant containing the correct value and a source of user |
| 98 | entry := optionalEntry.Expect("expected there to be a value") |
| 99 | require.Equal(t, "top-level-value", entry.Value) |
| 100 | require.Equal(t, gh.ConfigUserProvided, entry.Source) |
| 101 | } |
| 102 | |
| 103 | func TestGetOrDefaultExistingHostSpecificKey(t *testing.T) { |
| 104 | // Given have a host specific config entry |
nothing calls this directly
no test coverage detected