-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgalaxy_test.go
39 lines (31 loc) · 903 Bytes
/
galaxy_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package ansible
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
)
const (
TestGalaxyBaseCmd = "ansible-galaxy"
TestRequirementsPath = "/requirements.yaml"
TestRolesPath = "/roles"
)
var TestGalaxyCmd = fmt.Sprintf("%s install -r %s -p %s", TestGalaxyBaseCmd, TestRequirementsPath, TestRolesPath)
func TestGalaxy(t *testing.T) {
g := Galaxy()
assert.Empty(t, g.requirementsPath)
assert.Empty(t, g.rolesPath)
}
func TestGalaxy_Requirements(t *testing.T) {
g := Galaxy().Requirements(TestRequirementsPath)
assert.Equal(t, TestRequirementsPath, g.requirementsPath)
}
func TestGalaxy_RolesPath(t *testing.T) {
g := Galaxy().RolesPath(TestRolesPath)
assert.Equal(t, TestRolesPath, g.rolesPath)
}
func TestGalaxy_Command(t *testing.T) {
g := Galaxy().
RolesPath(TestRolesPath).
Requirements(TestRequirementsPath)
assert.Equal(t, g.Command(), TestGalaxyCmd)
}