@@ -37,16 +37,16 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
37
37
It ("returns empty lists for an empty Manifests" , func () {
38
38
c .Roles = []rbacv1.Role {}
39
39
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
40
- Expect (inPerm ).To (HaveLen ( 0 ))
41
- Expect (inCPerm ).To (HaveLen ( 0 ))
42
- Expect (out ).To (HaveLen ( 0 ))
40
+ Expect (inPerm ).To (BeEmpty ( ))
41
+ Expect (inCPerm ).To (BeEmpty ( ))
42
+ Expect (out ).To (BeEmpty ( ))
43
43
})
44
44
45
45
It ("splitting 1 Role no RoleBinding" , func () {
46
46
c .Roles = []rbacv1.Role {newRole ("my-role" )}
47
47
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
48
- Expect (inPerm ).To (HaveLen ( 0 ))
49
- Expect (inCPerm ).To (HaveLen ( 0 ))
48
+ Expect (inPerm ).To (BeEmpty ( ))
49
+ Expect (inCPerm ).To (BeEmpty ( ))
50
50
Expect (out ).To (HaveLen (1 ))
51
51
Expect (getRoleNames (out )).To (Equal ([]string {"my-role" }))
52
52
})
@@ -58,8 +58,8 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
58
58
newRoleBinding ("my-role-binding" , newRoleRef ("my-role" ), newServiceAccountSubject ("my-other-account" )),
59
59
}
60
60
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
61
- Expect (inPerm ).To (HaveLen ( 0 ))
62
- Expect (inCPerm ).To (HaveLen ( 0 ))
61
+ Expect (inPerm ).To (BeEmpty ( ))
62
+ Expect (inCPerm ).To (BeEmpty ( ))
63
63
Expect (out ).To (HaveLen (2 ))
64
64
Expect (getRoleNames (out )).To (Equal ([]string {"my-role" }))
65
65
Expect (getRoleBindingNames (out )).To (Equal ([]string {"my-role-binding" }))
@@ -72,8 +72,8 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
72
72
newRoleBinding ("my-role-binding" , newClusterRoleRef ("my-role" ), newServiceAccountSubject ("my-other-account" )),
73
73
}
74
74
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
75
- Expect (inPerm ).To (HaveLen ( 0 ))
76
- Expect (inCPerm ).To (HaveLen ( 0 ))
75
+ Expect (inPerm ).To (BeEmpty ( ))
76
+ Expect (inCPerm ).To (BeEmpty ( ))
77
77
Expect (out ).To (HaveLen (2 ))
78
78
Expect (getClusterRoleNames (out )).To (Equal ([]string {"my-role" }))
79
79
Expect (getRoleBindingNames (out )).To (Equal ([]string {"my-role-binding" }))
@@ -88,8 +88,8 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
88
88
newRoleBinding ("my-role-binding-2" , newClusterRoleRef ("my-role" ), newServiceAccountSubject ("my-other-account" )),
89
89
}
90
90
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
91
- Expect (inPerm ).To (HaveLen ( 0 ))
92
- Expect (inCPerm ).To (HaveLen ( 0 ))
91
+ Expect (inPerm ).To (BeEmpty ( ))
92
+ Expect (inCPerm ).To (BeEmpty ( ))
93
93
Expect (out ).To (HaveLen (4 ))
94
94
Expect (getRoleNames (out )).To (Equal ([]string {"my-role" }))
95
95
Expect (getClusterRoleNames (out )).To (Equal ([]string {"my-role" }))
@@ -105,8 +105,8 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
105
105
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
106
106
Expect (inPerm ).To (HaveLen (1 ))
107
107
Expect (getRoleNames (inPerm )).To (Equal ([]string {"my-role" }))
108
- Expect (inCPerm ).To (HaveLen ( 0 ))
109
- Expect (out ).To (HaveLen ( 0 ))
108
+ Expect (inCPerm ).To (BeEmpty ( ))
109
+ Expect (out ).To (BeEmpty ( ))
110
110
})
111
111
112
112
It ("splitting 1 ClusterRole 1 RoleBinding with 1 Subject containing a Deployment serviceAccountName" , func () {
@@ -118,8 +118,8 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
118
118
inPerm , inCPerm , out = c .SplitCSVPermissionsObjects (nil )
119
119
Expect (inPerm ).To (HaveLen (1 ))
120
120
Expect (getClusterRoleNames (inPerm )).To (Equal ([]string {"my-role" }))
121
- Expect (inCPerm ).To (HaveLen ( 0 ))
122
- Expect (out ).To (HaveLen ( 0 ))
121
+ Expect (inCPerm ).To (BeEmpty ( ))
122
+ Expect (out ).To (BeEmpty ( ))
123
123
})
124
124
125
125
It ("splitting 1 Role 1 ClusterRole 1 RoleBinding with 1 Subject containing a Deployment serviceAccountName" , func () {
@@ -134,8 +134,8 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
134
134
Expect (inPerm ).To (HaveLen (2 ))
135
135
Expect (getRoleNames (inPerm )).To (Equal ([]string {"my-role" }))
136
136
Expect (getClusterRoleNames (inPerm )).To (Equal ([]string {"my-role" }))
137
- Expect (inCPerm ).To (HaveLen ( 0 ))
138
- Expect (out ).To (HaveLen ( 0 ))
137
+ Expect (inCPerm ).To (BeEmpty ( ))
138
+ Expect (out ).To (BeEmpty ( ))
139
139
})
140
140
141
141
It ("splitting 1 Role 1 ClusterRole 1 RoleBinding with 2 Subjects containing a Deployment serviceAccountName" , func () {
@@ -219,7 +219,7 @@ var _ = Describe("SplitCSVPermissionsObjects", func() {
219
219
Expect (getClusterRoleNames (inPerm )).To (Equal ([]string {roleName1 }))
220
220
Expect (inCPerm ).To (HaveLen (2 ))
221
221
Expect (getClusterRoleNames (inCPerm )).To (Equal ([]string {roleName1 , roleName2 }))
222
- Expect (out ).To (HaveLen ( 0 ))
222
+ Expect (out ).To (BeEmpty ( ))
223
223
})
224
224
})
225
225
})
0 commit comments