github.com/Benchkram/bob@v0.0.0-20220321080157-7c8f3876e225/test/e2e/version/version_test.go (about)

     1  package version_test
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/Benchkram/bob/bob"
     7  	"github.com/Benchkram/errz"
     8  
     9  	. "github.com/onsi/ginkgo"
    10  	. "github.com/onsi/gomega"
    11  )
    12  
    13  var _ = Describe("Test bob's file export validation", func() {
    14  	Context("in a fresh environment", func() {
    15  		It("initializes bob playground with bob v1.0.0", func() {
    16  			bob.Version = "1.0.0"
    17  
    18  			Expect(bob.CreatePlayground(dir)).NotTo(HaveOccurred())
    19  		})
    20  
    21  		It("run verify and make sure no warnings are shown", func() {
    22  			capture()
    23  
    24  			err := b.Verify(context.Background())
    25  			Expect(err).NotTo(HaveOccurred())
    26  
    27  			out := output()
    28  
    29  			Expect(out).NotTo(ContainSubstring("major version mismatch"))
    30  			Expect(out).NotTo(ContainSubstring("possible version incompatibility"))
    31  		})
    32  
    33  		It("make sure warnings are shown on build", func() {
    34  			capture()
    35  
    36  			ctx := context.Background()
    37  			err := b.Build(ctx, "build")
    38  			errz.Log(err)
    39  			Expect(err).NotTo(HaveOccurred())
    40  
    41  			out := output()
    42  			Expect(out).To(ContainSubstring("major version mismatch"))
    43  			Expect(out).To(ContainSubstring("possible version incompatibility"))
    44  		})
    45  	})
    46  })