mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-24 10:07:21 +02:00
31 lines
668 B
Go
31 lines
668 B
Go
package web
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestWithSync(t *testing.T) {
|
|
opts := new(Options)
|
|
WithSync(time.Minute)(opts)
|
|
if got, want := opts.sync, time.Minute; got != want {
|
|
t.Errorf("Want sync duration %v, got %v", want, got)
|
|
}
|
|
}
|
|
|
|
func TestWithDir(t *testing.T) {
|
|
opts := new(Options)
|
|
WithDir("/tmp/www")(opts)
|
|
if got, want := opts.path, "/tmp/www"; got != want {
|
|
t.Errorf("Want www directory %q, got %q", want, got)
|
|
}
|
|
}
|
|
|
|
func TestWithDocs(t *testing.T) {
|
|
opts := new(Options)
|
|
WithDocs("http://docs.drone.io")(opts)
|
|
if got, want := opts.docs, "http://docs.drone.io"; got != want {
|
|
t.Errorf("Want documentation url %q, got %q", want, got)
|
|
}
|
|
}
|