예제 #1
0
import (
	"errors"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	. "github.com/cloudfoundry-incubator/garden/client"
	"github.com/cloudfoundry-incubator/garden/client/connection"
	"github.com/cloudfoundry-incubator/garden/client/connection/fake_connection"
	"github.com/cloudfoundry-incubator/garden/warden"
)

var _ = Describe("Client", func() {
	var connectionProvider ConnectionProvider
	var client Client

	var fakeConnection *fake_connection.FakeConnection

	BeforeEach(func() {
		fakeConnection = fake_connection.New()

		connectionProvider = &FakeConnectionProvider{
			Connection: fakeConnection,
		}
	})

	JustBeforeEach(func() {
		client = New(connectionProvider)
	})

	Describe("when the connection is broken", func() {
		var reconnectedConnection *fake_connection.FakeConnection
예제 #2
0
	. "github.com/onsi/gomega"
	"io"
	"io/ioutil"
	"strings"

	. "github.com/cloudfoundry-incubator/garden/client"
	"github.com/cloudfoundry-incubator/garden/client/connection"
	"github.com/cloudfoundry-incubator/garden/client/connection/fake_connection"
	"github.com/cloudfoundry-incubator/garden/warden"
)

var _ = Describe("Container", func() {
	var connectionProvider ConnectionProvider
	var container warden.Container

	var fakeConnection *fake_connection.FakeConnection

	BeforeEach(func() {
		fakeConnection = fake_connection.New()

		connectionProvider = &FakeConnectionProvider{
			Connection: fakeConnection,
		}
	})

	JustBeforeEach(func() {
		var err error

		client := New(connectionProvider)

		fakeConnection.WhenCreating = func(warden.ContainerSpec) (string, error) {