github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/api/plugin/plugin_suite_test.go (about)

     1  package plugin_test
     2  
     3  import (
     4  	"bytes"
     5  	"log"
     6  
     7  	. "code.cloudfoundry.org/cli/api/plugin"
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  	. "github.com/onsi/gomega/ghttp"
    11  
    12  	"testing"
    13  )
    14  
    15  func TestPlugin(t *testing.T) {
    16  	RegisterFailHandler(Fail)
    17  	RunSpecs(t, "Plugin Suite")
    18  }
    19  
    20  var server *Server
    21  
    22  var _ = SynchronizedBeforeSuite(func() []byte {
    23  	return []byte{}
    24  }, func(data []byte) {
    25  	server = NewTLSServer()
    26  
    27  	// Suppresses ginkgo server logs
    28  	server.HTTPTestServer.Config.ErrorLog = log.New(&bytes.Buffer{}, "", 0)
    29  })
    30  
    31  var _ = SynchronizedAfterSuite(func() {
    32  	server.Close()
    33  }, func() {})
    34  
    35  var _ = BeforeEach(func() {
    36  	server.Reset()
    37  })
    38  
    39  func NewTestClient() *Client {
    40  	return NewClient(Config{SkipSSLValidation: true, AppName: "CF CLI API Plugin Test", AppVersion: "Unknown"})
    41  }