1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-18 08:26:45 +02:00
woodpecker/plugins/secrets/vault/opts_test.go
2018-02-21 14:12:10 -08:00

29 lines
570 B
Go

// Copyright 2018 Drone.IO Inc
// Use of this software is governed by the Drone Enterpise License
// that can be found in the LICENSE file.
package vault
import (
"testing"
"time"
)
func TestWithTTL(t *testing.T) {
v := new(vault)
opt := WithTTL(time.Hour)
opt(v)
if got, want := v.ttl, time.Hour; got != want {
t.Errorf("Want ttl %v, got %v", want, got)
}
}
func TestWithRenewal(t *testing.T) {
v := new(vault)
opt := WithRenewal(time.Hour)
opt(v)
if got, want := v.renew, time.Hour; got != want {
t.Errorf("Want renewal %v, got %v", want, got)
}
}