mirror of
https://github.com/nxshock/gron.git
synced 2024-11-27 03:41:00 +05:00
25 lines
508 B
Go
25 lines
508 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestReadJob(t *testing.T) {
|
|
expectedJob := &Job{
|
|
Name: "job",
|
|
JobConfig: JobConfig{
|
|
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)
|
|
}
|