Skip to content

Commit

Permalink
Replace ginkgo When() calls with Context()
Browse files Browse the repository at this point in the history
It seems like running 'glide up' triggers a downgrade of ginkgo. To get
the code to compile it is necessary to replace all When() calls with
Context() calls. Since When() is just a newer synonym for Context() this
should not be a problem.
  • Loading branch information
gonzolino committed Jan 7, 2019
1 parent 0c91173 commit 1b8dc28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var _ = Describe("Mutating Webhook Namespace Limits", func() {
namespaceLimitInformer.GetIndexer().Add(namespaceLimit)
})

When("VMI has limits under spec", func() {
Context("VMI has limits under spec", func() {
It("should not apply namespace limits", func() {
vmiCopy := vmi.DeepCopy()
vmiCopy.Spec.Domain.Resources.Limits = k8sv1.ResourceList{
Expand All @@ -81,7 +81,7 @@ var _ = Describe("Mutating Webhook Namespace Limits", func() {
})
})

When("VMI does not have limits under spec", func() {
Context("VMI does not have limits under spec", func() {
It("should apply namespace limits", func() {
vmiCopy := vmi.DeepCopy()
By("Applying namespace range values on the VMI")
Expand All @@ -90,7 +90,7 @@ var _ = Describe("Mutating Webhook Namespace Limits", func() {
Expect(vmiCopy.Spec.Domain.Resources.Limits.Memory().String()).To(Equal("128M"))
})

When("namespace limit equals 0", func() {
Context("namespace limit equals 0", func() {
It("should not apply namespace limits", func() {
vmiCopy := vmi.DeepCopy()

Expand All @@ -109,7 +109,7 @@ var _ = Describe("Mutating Webhook Namespace Limits", func() {
})
})

When("namespace has more than one limit range", func() {
Context("namespace has more than one limit range", func() {
var additionalNamespaceLimit *k8sv1.LimitRange

BeforeEach(func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/virt-api/webhooks/mutating-webhook/preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ var _ = Describe("Mutating Webhook Presets", func() {
presetInformer, _ = testutils.NewFakeInformerFor(&v1.VirtualMachineInstancePreset{})
})

When("VMI has exclusion annotation", func() {
Context("VMI has exclusion annotation", func() {
It("Should be skipped", func() {
preset.Spec.Domain.CPU = &v1.CPU{Cores: 4}
presetInformer.GetIndexer().Add(preset)
Expand Down
2 changes: 1 addition & 1 deletion tests/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ var _ = Describe("Templates", func() {
It("should succeed to create VirtualMachine via oc command", AssertVMCreationSuccess())
It("should fail to delete VirtualMachine via oc command", AssertVMDeletionFailure())

When("the VirtualMachine was created", func() {
Context("the VirtualMachine was created", func() {
BeforeEach(AssertVMCreationSuccess())
It("should succeed to start the VirtualMachine via oc command", AssertVMStartSuccess("oc"))
It("should succeed to delete VirtualMachine via oc command", AssertVMDeletionSuccess())
Expand Down

0 comments on commit 1b8dc28

Please sign in to comment.