1
0
mirror of https://github.com/nxshock/gron.git synced 2024-11-27 03:41:00 +05:00
gron/job_test.go

26 lines
540 B
Go
Raw Normal View History

2022-03-29 21:38:04 +05:00
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestReadJob(t *testing.T) {
expectedJob := &Job{
Name: "job",
JobConfig: JobConfig{
2022-05-10 19:44:41 +05:00
Type: Cmd,
2022-03-29 21:38:04 +05:00
Cron: "* * * * *",
Command: `command "param1 param1" param2`,
Description: "comment",
NumberOfRestartAttemts: 3,
RestartSec: 5,
RestartRule: OnError}}
job, err := readJob("tests/job.conf")
assert.NoError(t, err)
assert.Equal(t, expectedJob, job)
}