github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/util/ui/uifakes/fake_config.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package uifakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/liamawhite/cli-with-i18n/util/configv3"
     8  	"github.com/liamawhite/cli-with-i18n/util/ui"
     9  )
    10  
    11  type FakeConfig struct {
    12  	ColorEnabledStub        func() configv3.ColorSetting
    13  	colorEnabledMutex       sync.RWMutex
    14  	colorEnabledArgsForCall []struct{}
    15  	colorEnabledReturns     struct {
    16  		result1 configv3.ColorSetting
    17  	}
    18  	colorEnabledReturnsOnCall map[int]struct {
    19  		result1 configv3.ColorSetting
    20  	}
    21  	LocaleStub        func() string
    22  	localeMutex       sync.RWMutex
    23  	localeArgsForCall []struct{}
    24  	localeReturns     struct {
    25  		result1 string
    26  	}
    27  	localeReturnsOnCall map[int]struct {
    28  		result1 string
    29  	}
    30  	IsTTYStub        func() bool
    31  	isTTYMutex       sync.RWMutex
    32  	isTTYArgsForCall []struct{}
    33  	isTTYReturns     struct {
    34  		result1 bool
    35  	}
    36  	isTTYReturnsOnCall map[int]struct {
    37  		result1 bool
    38  	}
    39  	TerminalWidthStub        func() int
    40  	terminalWidthMutex       sync.RWMutex
    41  	terminalWidthArgsForCall []struct{}
    42  	terminalWidthReturns     struct {
    43  		result1 int
    44  	}
    45  	terminalWidthReturnsOnCall map[int]struct {
    46  		result1 int
    47  	}
    48  	invocations      map[string][][]interface{}
    49  	invocationsMutex sync.RWMutex
    50  }
    51  
    52  func (fake *FakeConfig) ColorEnabled() configv3.ColorSetting {
    53  	fake.colorEnabledMutex.Lock()
    54  	ret, specificReturn := fake.colorEnabledReturnsOnCall[len(fake.colorEnabledArgsForCall)]
    55  	fake.colorEnabledArgsForCall = append(fake.colorEnabledArgsForCall, struct{}{})
    56  	fake.recordInvocation("ColorEnabled", []interface{}{})
    57  	fake.colorEnabledMutex.Unlock()
    58  	if fake.ColorEnabledStub != nil {
    59  		return fake.ColorEnabledStub()
    60  	}
    61  	if specificReturn {
    62  		return ret.result1
    63  	}
    64  	return fake.colorEnabledReturns.result1
    65  }
    66  
    67  func (fake *FakeConfig) ColorEnabledCallCount() int {
    68  	fake.colorEnabledMutex.RLock()
    69  	defer fake.colorEnabledMutex.RUnlock()
    70  	return len(fake.colorEnabledArgsForCall)
    71  }
    72  
    73  func (fake *FakeConfig) ColorEnabledReturns(result1 configv3.ColorSetting) {
    74  	fake.ColorEnabledStub = nil
    75  	fake.colorEnabledReturns = struct {
    76  		result1 configv3.ColorSetting
    77  	}{result1}
    78  }
    79  
    80  func (fake *FakeConfig) ColorEnabledReturnsOnCall(i int, result1 configv3.ColorSetting) {
    81  	fake.ColorEnabledStub = nil
    82  	if fake.colorEnabledReturnsOnCall == nil {
    83  		fake.colorEnabledReturnsOnCall = make(map[int]struct {
    84  			result1 configv3.ColorSetting
    85  		})
    86  	}
    87  	fake.colorEnabledReturnsOnCall[i] = struct {
    88  		result1 configv3.ColorSetting
    89  	}{result1}
    90  }
    91  
    92  func (fake *FakeConfig) Locale() string {
    93  	fake.localeMutex.Lock()
    94  	ret, specificReturn := fake.localeReturnsOnCall[len(fake.localeArgsForCall)]
    95  	fake.localeArgsForCall = append(fake.localeArgsForCall, struct{}{})
    96  	fake.recordInvocation("Locale", []interface{}{})
    97  	fake.localeMutex.Unlock()
    98  	if fake.LocaleStub != nil {
    99  		return fake.LocaleStub()
   100  	}
   101  	if specificReturn {
   102  		return ret.result1
   103  	}
   104  	return fake.localeReturns.result1
   105  }
   106  
   107  func (fake *FakeConfig) LocaleCallCount() int {
   108  	fake.localeMutex.RLock()
   109  	defer fake.localeMutex.RUnlock()
   110  	return len(fake.localeArgsForCall)
   111  }
   112  
   113  func (fake *FakeConfig) LocaleReturns(result1 string) {
   114  	fake.LocaleStub = nil
   115  	fake.localeReturns = struct {
   116  		result1 string
   117  	}{result1}
   118  }
   119  
   120  func (fake *FakeConfig) LocaleReturnsOnCall(i int, result1 string) {
   121  	fake.LocaleStub = nil
   122  	if fake.localeReturnsOnCall == nil {
   123  		fake.localeReturnsOnCall = make(map[int]struct {
   124  			result1 string
   125  		})
   126  	}
   127  	fake.localeReturnsOnCall[i] = struct {
   128  		result1 string
   129  	}{result1}
   130  }
   131  
   132  func (fake *FakeConfig) IsTTY() bool {
   133  	fake.isTTYMutex.Lock()
   134  	ret, specificReturn := fake.isTTYReturnsOnCall[len(fake.isTTYArgsForCall)]
   135  	fake.isTTYArgsForCall = append(fake.isTTYArgsForCall, struct{}{})
   136  	fake.recordInvocation("IsTTY", []interface{}{})
   137  	fake.isTTYMutex.Unlock()
   138  	if fake.IsTTYStub != nil {
   139  		return fake.IsTTYStub()
   140  	}
   141  	if specificReturn {
   142  		return ret.result1
   143  	}
   144  	return fake.isTTYReturns.result1
   145  }
   146  
   147  func (fake *FakeConfig) IsTTYCallCount() int {
   148  	fake.isTTYMutex.RLock()
   149  	defer fake.isTTYMutex.RUnlock()
   150  	return len(fake.isTTYArgsForCall)
   151  }
   152  
   153  func (fake *FakeConfig) IsTTYReturns(result1 bool) {
   154  	fake.IsTTYStub = nil
   155  	fake.isTTYReturns = struct {
   156  		result1 bool
   157  	}{result1}
   158  }
   159  
   160  func (fake *FakeConfig) IsTTYReturnsOnCall(i int, result1 bool) {
   161  	fake.IsTTYStub = nil
   162  	if fake.isTTYReturnsOnCall == nil {
   163  		fake.isTTYReturnsOnCall = make(map[int]struct {
   164  			result1 bool
   165  		})
   166  	}
   167  	fake.isTTYReturnsOnCall[i] = struct {
   168  		result1 bool
   169  	}{result1}
   170  }
   171  
   172  func (fake *FakeConfig) TerminalWidth() int {
   173  	fake.terminalWidthMutex.Lock()
   174  	ret, specificReturn := fake.terminalWidthReturnsOnCall[len(fake.terminalWidthArgsForCall)]
   175  	fake.terminalWidthArgsForCall = append(fake.terminalWidthArgsForCall, struct{}{})
   176  	fake.recordInvocation("TerminalWidth", []interface{}{})
   177  	fake.terminalWidthMutex.Unlock()
   178  	if fake.TerminalWidthStub != nil {
   179  		return fake.TerminalWidthStub()
   180  	}
   181  	if specificReturn {
   182  		return ret.result1
   183  	}
   184  	return fake.terminalWidthReturns.result1
   185  }
   186  
   187  func (fake *FakeConfig) TerminalWidthCallCount() int {
   188  	fake.terminalWidthMutex.RLock()
   189  	defer fake.terminalWidthMutex.RUnlock()
   190  	return len(fake.terminalWidthArgsForCall)
   191  }
   192  
   193  func (fake *FakeConfig) TerminalWidthReturns(result1 int) {
   194  	fake.TerminalWidthStub = nil
   195  	fake.terminalWidthReturns = struct {
   196  		result1 int
   197  	}{result1}
   198  }
   199  
   200  func (fake *FakeConfig) TerminalWidthReturnsOnCall(i int, result1 int) {
   201  	fake.TerminalWidthStub = nil
   202  	if fake.terminalWidthReturnsOnCall == nil {
   203  		fake.terminalWidthReturnsOnCall = make(map[int]struct {
   204  			result1 int
   205  		})
   206  	}
   207  	fake.terminalWidthReturnsOnCall[i] = struct {
   208  		result1 int
   209  	}{result1}
   210  }
   211  
   212  func (fake *FakeConfig) Invocations() map[string][][]interface{} {
   213  	fake.invocationsMutex.RLock()
   214  	defer fake.invocationsMutex.RUnlock()
   215  	fake.colorEnabledMutex.RLock()
   216  	defer fake.colorEnabledMutex.RUnlock()
   217  	fake.localeMutex.RLock()
   218  	defer fake.localeMutex.RUnlock()
   219  	fake.isTTYMutex.RLock()
   220  	defer fake.isTTYMutex.RUnlock()
   221  	fake.terminalWidthMutex.RLock()
   222  	defer fake.terminalWidthMutex.RUnlock()
   223  	copiedInvocations := map[string][][]interface{}{}
   224  	for key, value := range fake.invocations {
   225  		copiedInvocations[key] = value
   226  	}
   227  	return copiedInvocations
   228  }
   229  
   230  func (fake *FakeConfig) recordInvocation(key string, args []interface{}) {
   231  	fake.invocationsMutex.Lock()
   232  	defer fake.invocationsMutex.Unlock()
   233  	if fake.invocations == nil {
   234  		fake.invocations = map[string][][]interface{}{}
   235  	}
   236  	if fake.invocations[key] == nil {
   237  		fake.invocations[key] = [][]interface{}{}
   238  	}
   239  	fake.invocations[key] = append(fake.invocations[key], args)
   240  }
   241  
   242  var _ ui.Config = new(FakeConfig)