move cron parse into feed.ShouldExecute
This commit is contained in:
@@ -1 +1,32 @@
|
||||
package feeds_test
|
||||
|
||||
import (
|
||||
"show-rss/src/feeds"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestFeed(t *testing.T) {
|
||||
t.Run("fetch", func(t *testing.T) {
|
||||
created := time.Now().Add(-4 * time.Second)
|
||||
feed := feeds.Feed{
|
||||
Entry: feeds.Entry{
|
||||
ID: "id",
|
||||
Created: created,
|
||||
Updated: created,
|
||||
Deleted: time.Time{},
|
||||
},
|
||||
Version: feeds.Version{
|
||||
Created: created,
|
||||
URL: "url",
|
||||
Cron: "* * * * *",
|
||||
Pattern: "matches",
|
||||
},
|
||||
Execution: feeds.Execution{
|
||||
Executed: created.Add(-2 * time.Second),
|
||||
Version: created,
|
||||
},
|
||||
}
|
||||
_ = feed
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user