github.com/elopio/cli@v6.21.2-0.20160902224010-ea909d1fdb2f+incompatible/commands/commandsfakes/fake_config.go (about)

     1  // This file was generated by counterfeiter
     2  package commandsfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/commands"
     8  	"code.cloudfoundry.org/cli/utils/config"
     9  )
    10  
    11  type FakeConfig struct {
    12  	BinaryNameStub        func() string
    13  	binaryNameMutex       sync.RWMutex
    14  	binaryNameArgsForCall []struct{}
    15  	binaryNameReturns     struct {
    16  		result1 string
    17  	}
    18  	ColorEnabledStub        func() config.ColorSetting
    19  	colorEnabledMutex       sync.RWMutex
    20  	colorEnabledArgsForCall []struct{}
    21  	colorEnabledReturns     struct {
    22  		result1 config.ColorSetting
    23  	}
    24  	LocaleStub        func() string
    25  	localeMutex       sync.RWMutex
    26  	localeArgsForCall []struct{}
    27  	localeReturns     struct {
    28  		result1 string
    29  	}
    30  	PluginConfigStub        func() map[string]config.PluginConfig
    31  	pluginConfigMutex       sync.RWMutex
    32  	pluginConfigArgsForCall []struct{}
    33  	pluginConfigReturns     struct {
    34  		result1 map[string]config.PluginConfig
    35  	}
    36  	invocations      map[string][][]interface{}
    37  	invocationsMutex sync.RWMutex
    38  }
    39  
    40  func (fake *FakeConfig) BinaryName() string {
    41  	fake.binaryNameMutex.Lock()
    42  	fake.binaryNameArgsForCall = append(fake.binaryNameArgsForCall, struct{}{})
    43  	fake.recordInvocation("BinaryName", []interface{}{})
    44  	fake.binaryNameMutex.Unlock()
    45  	if fake.BinaryNameStub != nil {
    46  		return fake.BinaryNameStub()
    47  	} else {
    48  		return fake.binaryNameReturns.result1
    49  	}
    50  }
    51  
    52  func (fake *FakeConfig) BinaryNameCallCount() int {
    53  	fake.binaryNameMutex.RLock()
    54  	defer fake.binaryNameMutex.RUnlock()
    55  	return len(fake.binaryNameArgsForCall)
    56  }
    57  
    58  func (fake *FakeConfig) BinaryNameReturns(result1 string) {
    59  	fake.BinaryNameStub = nil
    60  	fake.binaryNameReturns = struct {
    61  		result1 string
    62  	}{result1}
    63  }
    64  
    65  func (fake *FakeConfig) ColorEnabled() config.ColorSetting {
    66  	fake.colorEnabledMutex.Lock()
    67  	fake.colorEnabledArgsForCall = append(fake.colorEnabledArgsForCall, struct{}{})
    68  	fake.recordInvocation("ColorEnabled", []interface{}{})
    69  	fake.colorEnabledMutex.Unlock()
    70  	if fake.ColorEnabledStub != nil {
    71  		return fake.ColorEnabledStub()
    72  	} else {
    73  		return fake.colorEnabledReturns.result1
    74  	}
    75  }
    76  
    77  func (fake *FakeConfig) ColorEnabledCallCount() int {
    78  	fake.colorEnabledMutex.RLock()
    79  	defer fake.colorEnabledMutex.RUnlock()
    80  	return len(fake.colorEnabledArgsForCall)
    81  }
    82  
    83  func (fake *FakeConfig) ColorEnabledReturns(result1 config.ColorSetting) {
    84  	fake.ColorEnabledStub = nil
    85  	fake.colorEnabledReturns = struct {
    86  		result1 config.ColorSetting
    87  	}{result1}
    88  }
    89  
    90  func (fake *FakeConfig) Locale() string {
    91  	fake.localeMutex.Lock()
    92  	fake.localeArgsForCall = append(fake.localeArgsForCall, struct{}{})
    93  	fake.recordInvocation("Locale", []interface{}{})
    94  	fake.localeMutex.Unlock()
    95  	if fake.LocaleStub != nil {
    96  		return fake.LocaleStub()
    97  	} else {
    98  		return fake.localeReturns.result1
    99  	}
   100  }
   101  
   102  func (fake *FakeConfig) LocaleCallCount() int {
   103  	fake.localeMutex.RLock()
   104  	defer fake.localeMutex.RUnlock()
   105  	return len(fake.localeArgsForCall)
   106  }
   107  
   108  func (fake *FakeConfig) LocaleReturns(result1 string) {
   109  	fake.LocaleStub = nil
   110  	fake.localeReturns = struct {
   111  		result1 string
   112  	}{result1}
   113  }
   114  
   115  func (fake *FakeConfig) PluginConfig() map[string]config.PluginConfig {
   116  	fake.pluginConfigMutex.Lock()
   117  	fake.pluginConfigArgsForCall = append(fake.pluginConfigArgsForCall, struct{}{})
   118  	fake.recordInvocation("PluginConfig", []interface{}{})
   119  	fake.pluginConfigMutex.Unlock()
   120  	if fake.PluginConfigStub != nil {
   121  		return fake.PluginConfigStub()
   122  	} else {
   123  		return fake.pluginConfigReturns.result1
   124  	}
   125  }
   126  
   127  func (fake *FakeConfig) PluginConfigCallCount() int {
   128  	fake.pluginConfigMutex.RLock()
   129  	defer fake.pluginConfigMutex.RUnlock()
   130  	return len(fake.pluginConfigArgsForCall)
   131  }
   132  
   133  func (fake *FakeConfig) PluginConfigReturns(result1 map[string]config.PluginConfig) {
   134  	fake.PluginConfigStub = nil
   135  	fake.pluginConfigReturns = struct {
   136  		result1 map[string]config.PluginConfig
   137  	}{result1}
   138  }
   139  
   140  func (fake *FakeConfig) Invocations() map[string][][]interface{} {
   141  	fake.invocationsMutex.RLock()
   142  	defer fake.invocationsMutex.RUnlock()
   143  	fake.binaryNameMutex.RLock()
   144  	defer fake.binaryNameMutex.RUnlock()
   145  	fake.colorEnabledMutex.RLock()
   146  	defer fake.colorEnabledMutex.RUnlock()
   147  	fake.localeMutex.RLock()
   148  	defer fake.localeMutex.RUnlock()
   149  	fake.pluginConfigMutex.RLock()
   150  	defer fake.pluginConfigMutex.RUnlock()
   151  	return fake.invocations
   152  }
   153  
   154  func (fake *FakeConfig) recordInvocation(key string, args []interface{}) {
   155  	fake.invocationsMutex.Lock()
   156  	defer fake.invocationsMutex.Unlock()
   157  	if fake.invocations == nil {
   158  		fake.invocations = map[string][][]interface{}{}
   159  	}
   160  	if fake.invocations[key] == nil {
   161  		fake.invocations[key] = [][]interface{}{}
   162  	}
   163  	fake.invocations[key] = append(fake.invocations[key], args)
   164  }
   165  
   166  var _ commands.Config = new(FakeConfig)