@@ -17,8 +17,6 @@ limitations under the License.
1717package fake
1818
1919import (
20- "encoding/json"
21-
2220 . "github.com/onsi/ginkgo"
2321 . "github.com/onsi/gomega"
2422
@@ -68,22 +66,13 @@ var _ = Describe("Fake client", func() {
6866
6967 It ("should be able to List" , func () {
7068 By ("Listing all deployments in a namespace" )
71- list := & metav1. List {}
69+ list := & appsv1. DeploymentList {}
7270 err := cl .List (nil , & client.ListOptions {
7371 Namespace : "ns1" ,
74- Raw : & metav1.ListOptions {
75- TypeMeta : metav1.TypeMeta {
76- APIVersion : "apps/v1" ,
77- Kind : "Deployment" ,
78- },
79- },
8072 }, list )
8173 Expect (err ).To (BeNil ())
8274 Expect (list .Items ).To (HaveLen (1 ))
83- j , err := json .Marshal (dep )
84- Expect (err ).To (BeNil ())
85- expectedDep := runtime.RawExtension {Raw : j }
86- Expect (list .Items ).To (ConsistOf (expectedDep ))
75+ Expect (list .Items ).To (ConsistOf (* dep ))
8776 })
8877
8978 It ("should be able to Create" , func () {
@@ -139,15 +128,9 @@ var _ = Describe("Fake client", func() {
139128 Expect (err ).To (BeNil ())
140129
141130 By ("Listing all deployments in the namespace" )
142- list := & metav1. List {}
131+ list := & appsv1. DeploymentList {}
143132 err = cl .List (nil , & client.ListOptions {
144133 Namespace : "ns1" ,
145- Raw : & metav1.ListOptions {
146- TypeMeta : metav1.TypeMeta {
147- APIVersion : "apps/v1" ,
148- Kind : "Deployment" ,
149- },
150- },
151134 }, list )
152135 Expect (err ).To (BeNil ())
153136 Expect (list .Items ).To (HaveLen (0 ))
0 commit comments