mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
28 lines
457 B
Go
28 lines
457 B
Go
|
package transform
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/drone/drone/yaml"
|
||
|
|
||
|
"github.com/franela/goblin"
|
||
|
)
|
||
|
|
||
|
func Test_env(t *testing.T) {
|
||
|
|
||
|
g := goblin.Goblin(t)
|
||
|
g.Describe("environment variables", func() {
|
||
|
|
||
|
g.It("should be copied", func() {
|
||
|
envs := map[string]string{"CI": "drone"}
|
||
|
|
||
|
c := newConfig(&yaml.Container{
|
||
|
Environment: map[string]string{},
|
||
|
})
|
||
|
|
||
|
Environ(c, envs)
|
||
|
g.Assert(c.Pipeline[0].Environment["CI"]).Equal("drone")
|
||
|
})
|
||
|
})
|
||
|
}
|