mirror of
https://github.com/cooperspencer/gickup
synced 2024-09-16 21:31:40 +02:00
646b792ac1
* chore: adding makefile * chore: adding lint * chore: update package name * lint: run with fix * chore: update main.go * chore: update main_test.go * chore: update types.go * chore: update logger.go * chore: update types_test.go * chore: update prometheus.go * chore: update local.go * chore: update gitlab.go * chore: update gogs.go * chore: update bitbucket.go * chore: update gitea.go * chore: update github.go * chore: update main*.go * chore: go mod tidy * chore: update action to have a correct working-directory
34 lines
566 B
Go
34 lines
566 B
Go
package types
|
|
|
|
import "testing"
|
|
|
|
func TestConfCronMissing(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
conf := Conf{Cron: ""}
|
|
|
|
if !conf.MissingCronSpec() {
|
|
t.Error("Conf passed empty cron spec doesn't think that it's missing")
|
|
}
|
|
}
|
|
|
|
func TestParseValidCron(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
conf := Conf{Cron: "0 0 * * *"}
|
|
|
|
if !conf.HasValidCronSpec() {
|
|
t.Error("Valid cron spec parsed invalidly")
|
|
}
|
|
}
|
|
|
|
func TestParseInvalidCron(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
conf := Conf{Cron: "redshirt"}
|
|
|
|
if conf.HasValidCronSpec() {
|
|
t.Error("Invalid cron spec parsed validly")
|
|
}
|
|
}
|