(t *testing.T)
| 171 | } |
| 172 | |
| 173 | func TestCRDObjects(t *testing.T) { |
| 174 | modTime := time.Now() |
| 175 | chrt := Chart{ |
| 176 | Files: []*common.File{ |
| 177 | { |
| 178 | Name: "crds/foo.yaml", |
| 179 | ModTime: modTime, |
| 180 | Data: []byte("hello"), |
| 181 | }, |
| 182 | { |
| 183 | Name: "bar.yaml", |
| 184 | ModTime: modTime, |
| 185 | Data: []byte("hello"), |
| 186 | }, |
| 187 | { |
| 188 | Name: "crds/foo/bar/baz.yaml", |
| 189 | ModTime: modTime, |
| 190 | Data: []byte("hello"), |
| 191 | }, |
| 192 | { |
| 193 | Name: "crdsfoo/bar/baz.yaml", |
| 194 | ModTime: modTime, |
| 195 | Data: []byte("hello"), |
| 196 | }, |
| 197 | { |
| 198 | Name: "crds/README.md", |
| 199 | ModTime: modTime, |
| 200 | Data: []byte("# hello"), |
| 201 | }, |
| 202 | }, |
| 203 | } |
| 204 | |
| 205 | expected := []CRD{ |
| 206 | { |
| 207 | Name: "crds/foo.yaml", |
| 208 | Filename: "crds/foo.yaml", |
| 209 | File: &common.File{ |
| 210 | Name: "crds/foo.yaml", |
| 211 | ModTime: modTime, |
| 212 | Data: []byte("hello"), |
| 213 | }, |
| 214 | }, |
| 215 | { |
| 216 | Name: "crds/foo/bar/baz.yaml", |
| 217 | Filename: "crds/foo/bar/baz.yaml", |
| 218 | File: &common.File{ |
| 219 | Name: "crds/foo/bar/baz.yaml", |
| 220 | ModTime: modTime, |
| 221 | Data: []byte("hello"), |
| 222 | }, |
| 223 | }, |
| 224 | } |
| 225 | |
| 226 | is := assert.New(t) |
| 227 | crds := chrt.CRDObjects() |
| 228 | is.Equal(expected, crds) |
| 229 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…