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

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