In order to pass in options like `--new-window` to an external viewer like `firefox`, optional args can now be defined in configuration. See config-example.yaml for an example.
35 lines
733 B
Go
35 lines
733 B
Go
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",
|
|
}
|
|
|
|
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,
|
|
)
|
|
}
|