move cron parse into feed.ShouldExecute

This commit is contained in:
Bel LaPointe
2025-04-27 12:04:11 -06:00
parent a097814a62
commit ab396d1833
3 changed files with 55 additions and 13 deletions

View File

@@ -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
})
}