We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1ce701 commit 7d80021Copy full SHA for 7d80021
cron_test.go
@@ -687,6 +687,25 @@ func wait(wg *sync.WaitGroup) chan bool {
687
return ch
688
}
689
690
+func TestIsRunning(t *testing.T) {
691
+ wg := &sync.WaitGroup{}
692
+ wg.Add(1)
693
+ cron := New()
694
+ cron.AddFunc("* * * * * ?", func() { wg.Done() })
695
+
696
+ cron.Start()
697
+ time.Sleep(1 * time.Second)
698
+ if !cron.IsRunning() {
699
+ t.Error("cron is reporting as not running when it should be running")
700
+ }
701
702
+ cron.Stop()
703
704
+ if cron.IsRunning() {
705
+ t.Error("cron is reporting as running when it should be not running")
706
707
+}
708
709
func stop(cron *Cron) chan bool {
710
ch := make(chan bool)
711
go func() {
0 commit comments