-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdependency_specifiers_test.go
More file actions
81 lines (65 loc) · 2.23 KB
/
Copy pathdependency_specifiers_test.go
File metadata and controls
81 lines (65 loc) · 2.23 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package integration_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
pivnet "github.com/pivotal-cf/go-pivnet/v9"
)
const (
dependentProductSlug = "stemcells"
dependencySpecifier = "3312.*"
)
var _ = Describe("Dependency Specifier Integration", func() {
var (
newRelease pivnet.Release
)
BeforeEach(func() {
var err error
newRelease, err = client.Releases.Create(pivnet.CreateReleaseConfig{
ProductSlug: testProductSlug,
Version: "some-test-version",
ReleaseType: "Beta Release",
EULASlug: "vmware-prerelease-eula",
})
Expect(err).NotTo(HaveOccurred())
})
AfterEach(func() {
err := client.Releases.Delete(testProductSlug, newRelease)
Expect(err).NotTo(HaveOccurred())
})
It("creates, lists, and deletes dependency specifiers", func() {
By("Listing dependency specifiers")
dependencySpecifiers, err := client.DependencySpecifiers.List(testProductSlug, newRelease.ID)
Expect(err).NotTo(HaveOccurred())
By("Creating new dependency specifier")
dependencySpecifier, err := client.DependencySpecifiers.Create(
testProductSlug,
newRelease.ID,
dependentProductSlug,
dependencySpecifier,
)
Expect(err).NotTo(HaveOccurred())
Expect(dependencySpecifiers).ShouldNot(ContainElement(dependencySpecifier))
By("Re-listing dependency specifiers")
updatedDependencySpecifiers, err := client.DependencySpecifiers.List(testProductSlug, newRelease.ID)
Expect(err).NotTo(HaveOccurred())
Expect(updatedDependencySpecifiers).Should(ContainElement(dependencySpecifier))
By("Getting individual dependency specifier")
individualDependencySpecifier, err := client.DependencySpecifiers.Get(
testProductSlug,
newRelease.ID,
dependencySpecifier.ID,
)
Expect(err).NotTo(HaveOccurred())
Expect(individualDependencySpecifier).To(Equal(dependencySpecifier))
By("Deleting dependency specifier")
err = client.DependencySpecifiers.Delete(
testProductSlug,
newRelease.ID,
dependencySpecifier.ID,
)
Expect(err).NotTo(HaveOccurred())
newlyUpdatedDependencySpecifiers, err := client.DependencySpecifiers.List(testProductSlug, newRelease.ID)
Expect(err).NotTo(HaveOccurred())
Expect(newlyUpdatedDependencySpecifiers).ShouldNot(ContainElement(dependencySpecifier))
})
})