Re-structure packages

Overhaul of package structure and other cleanup.
This commit is contained in:
Dave Gallant
2020-04-03 22:29:12 -04:00
parent 025b68de93
commit 49ea48976d
9 changed files with 87 additions and 71 deletions

36
config/config_test.go Normal file
View File

@@ -0,0 +1,36 @@
package config
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,
)
}