github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/old/rootfs_provider/fake_namespacer/fake_namespacer.go (about)

     1  // This file was generated by counterfeiter
     2  package fake_namespacer
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/cloudfoundry-incubator/garden-linux/old/rootfs_provider"
     8  )
     9  
    10  type FakeNamespacer struct {
    11  	NamespaceStub        func(rootfsPath string) error
    12  	namespaceMutex       sync.RWMutex
    13  	namespaceArgsForCall []struct {
    14  		rootfsPath string
    15  	}
    16  	namespaceReturns struct {
    17  		result1 error
    18  	}
    19  }
    20  
    21  func (fake *FakeNamespacer) Namespace(rootfsPath string) error {
    22  	fake.namespaceMutex.Lock()
    23  	fake.namespaceArgsForCall = append(fake.namespaceArgsForCall, struct {
    24  		rootfsPath string
    25  	}{rootfsPath})
    26  	fake.namespaceMutex.Unlock()
    27  	if fake.NamespaceStub != nil {
    28  		return fake.NamespaceStub(rootfsPath)
    29  	} else {
    30  		return fake.namespaceReturns.result1
    31  	}
    32  }
    33  
    34  func (fake *FakeNamespacer) NamespaceCallCount() int {
    35  	fake.namespaceMutex.RLock()
    36  	defer fake.namespaceMutex.RUnlock()
    37  	return len(fake.namespaceArgsForCall)
    38  }
    39  
    40  func (fake *FakeNamespacer) NamespaceArgsForCall(i int) string {
    41  	fake.namespaceMutex.RLock()
    42  	defer fake.namespaceMutex.RUnlock()
    43  	return fake.namespaceArgsForCall[i].rootfsPath
    44  }
    45  
    46  func (fake *FakeNamespacer) NamespaceReturns(result1 error) {
    47  	fake.NamespaceStub = nil
    48  	fake.namespaceReturns = struct {
    49  		result1 error
    50  	}{result1}
    51  }
    52  
    53  var _ rootfs_provider.Namespacer = new(FakeNamespacer)