This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
Files
srv/internal/config_test.go
2020-03-31 21:31:52 -04:00

37 lines
827 B
Go

package internal
import (
"testing"
"github.com/stretchr/testify/assert"
)
// TestLoadConfiguration tests loading the example config
func TestLoadConfiguration(t *testing.T) {
exampleConfig := LoadConfiguration("../config-example.yaml")
expectedFeeds := []string{
"https://news.ycombinator.com/rss",
"https://www.reddit.com/r/golang/.rss",
"https://www.reddit.com/r/linux/.rss",
"https://www.zdnet.com/topic/security/rss.xml",
"https://aws.amazon.com/blogs/security/feed/",
"https://www.archlinux.org/feeds/news/",
}
assert.Equal(
t,
expectedFeeds,
exampleConfig.Feeds,
"Expected configuration does not match.",
)
// ExternalViewer should default to either 'xdg-open' on Linux,
// or 'open' on macOS
assert.Contains(
t,
[]string{"xdg-open", "open"},
exampleConfig.ExternalViewer,
)
}