-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve flags implementation and usage text
- tests
- Loading branch information
1 parent
a5e8bfe
commit 93ce96b
Showing
15 changed files
with
1,012 additions
and
39 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
// This file was generated by counterfeiter | ||
package data_fakes | ||
|
||
import ( | ||
"sync" | ||
|
||
"github.com/simonleung8/cli-plugin-recorder/data" | ||
) | ||
|
||
type FakeCmdSetData struct { | ||
GetCmdSetStub func(string) []string | ||
getCmdSetMutex sync.RWMutex | ||
getCmdSetArgsForCall []struct { | ||
arg1 string | ||
} | ||
getCmdSetReturns struct { | ||
result1 []string | ||
} | ||
SaveCmdSetStub func(string, []string) | ||
saveCmdSetMutex sync.RWMutex | ||
saveCmdSetArgsForCall []struct { | ||
arg1 string | ||
arg2 []string | ||
} | ||
DeleteCmdSetStub func(string) | ||
deleteCmdSetMutex sync.RWMutex | ||
deleteCmdSetArgsForCall []struct { | ||
arg1 string | ||
} | ||
IsCmdExistStub func(t string) bool | ||
isCmdExistMutex sync.RWMutex | ||
isCmdExistArgsForCall []struct { | ||
t string | ||
} | ||
isCmdExistReturns struct { | ||
result1 bool | ||
} | ||
ListCmdSetNamesStub func() []string | ||
listCmdSetNamesMutex sync.RWMutex | ||
listCmdSetNamesArgsForCall []struct{} | ||
listCmdSetNamesReturns struct { | ||
result1 []string | ||
} | ||
ClearCmdSetsStub func() | ||
clearCmdSetsMutex sync.RWMutex | ||
clearCmdSetsArgsForCall []struct{} | ||
} | ||
|
||
func (fake *FakeCmdSetData) GetCmdSet(arg1 string) []string { | ||
fake.getCmdSetMutex.Lock() | ||
fake.getCmdSetArgsForCall = append(fake.getCmdSetArgsForCall, struct { | ||
arg1 string | ||
}{arg1}) | ||
fake.getCmdSetMutex.Unlock() | ||
if fake.GetCmdSetStub != nil { | ||
return fake.GetCmdSetStub(arg1) | ||
} else { | ||
return fake.getCmdSetReturns.result1 | ||
} | ||
} | ||
|
||
func (fake *FakeCmdSetData) GetCmdSetCallCount() int { | ||
fake.getCmdSetMutex.RLock() | ||
defer fake.getCmdSetMutex.RUnlock() | ||
return len(fake.getCmdSetArgsForCall) | ||
} | ||
|
||
func (fake *FakeCmdSetData) GetCmdSetArgsForCall(i int) string { | ||
fake.getCmdSetMutex.RLock() | ||
defer fake.getCmdSetMutex.RUnlock() | ||
return fake.getCmdSetArgsForCall[i].arg1 | ||
} | ||
|
||
func (fake *FakeCmdSetData) GetCmdSetReturns(result1 []string) { | ||
fake.GetCmdSetStub = nil | ||
fake.getCmdSetReturns = struct { | ||
result1 []string | ||
}{result1} | ||
} | ||
|
||
func (fake *FakeCmdSetData) SaveCmdSet(arg1 string, arg2 []string) { | ||
fake.saveCmdSetMutex.Lock() | ||
fake.saveCmdSetArgsForCall = append(fake.saveCmdSetArgsForCall, struct { | ||
arg1 string | ||
arg2 []string | ||
}{arg1, arg2}) | ||
fake.saveCmdSetMutex.Unlock() | ||
if fake.SaveCmdSetStub != nil { | ||
fake.SaveCmdSetStub(arg1, arg2) | ||
} | ||
} | ||
|
||
func (fake *FakeCmdSetData) SaveCmdSetCallCount() int { | ||
fake.saveCmdSetMutex.RLock() | ||
defer fake.saveCmdSetMutex.RUnlock() | ||
return len(fake.saveCmdSetArgsForCall) | ||
} | ||
|
||
func (fake *FakeCmdSetData) SaveCmdSetArgsForCall(i int) (string, []string) { | ||
fake.saveCmdSetMutex.RLock() | ||
defer fake.saveCmdSetMutex.RUnlock() | ||
return fake.saveCmdSetArgsForCall[i].arg1, fake.saveCmdSetArgsForCall[i].arg2 | ||
} | ||
|
||
func (fake *FakeCmdSetData) DeleteCmdSet(arg1 string) { | ||
fake.deleteCmdSetMutex.Lock() | ||
fake.deleteCmdSetArgsForCall = append(fake.deleteCmdSetArgsForCall, struct { | ||
arg1 string | ||
}{arg1}) | ||
fake.deleteCmdSetMutex.Unlock() | ||
if fake.DeleteCmdSetStub != nil { | ||
fake.DeleteCmdSetStub(arg1) | ||
} | ||
} | ||
|
||
func (fake *FakeCmdSetData) DeleteCmdSetCallCount() int { | ||
fake.deleteCmdSetMutex.RLock() | ||
defer fake.deleteCmdSetMutex.RUnlock() | ||
return len(fake.deleteCmdSetArgsForCall) | ||
} | ||
|
||
func (fake *FakeCmdSetData) DeleteCmdSetArgsForCall(i int) string { | ||
fake.deleteCmdSetMutex.RLock() | ||
defer fake.deleteCmdSetMutex.RUnlock() | ||
return fake.deleteCmdSetArgsForCall[i].arg1 | ||
} | ||
|
||
func (fake *FakeCmdSetData) IsCmdExist(t string) bool { | ||
fake.isCmdExistMutex.Lock() | ||
fake.isCmdExistArgsForCall = append(fake.isCmdExistArgsForCall, struct { | ||
t string | ||
}{t}) | ||
fake.isCmdExistMutex.Unlock() | ||
if fake.IsCmdExistStub != nil { | ||
return fake.IsCmdExistStub(t) | ||
} else { | ||
return fake.isCmdExistReturns.result1 | ||
} | ||
} | ||
|
||
func (fake *FakeCmdSetData) IsCmdExistCallCount() int { | ||
fake.isCmdExistMutex.RLock() | ||
defer fake.isCmdExistMutex.RUnlock() | ||
return len(fake.isCmdExistArgsForCall) | ||
} | ||
|
||
func (fake *FakeCmdSetData) IsCmdExistArgsForCall(i int) string { | ||
fake.isCmdExistMutex.RLock() | ||
defer fake.isCmdExistMutex.RUnlock() | ||
return fake.isCmdExistArgsForCall[i].t | ||
} | ||
|
||
func (fake *FakeCmdSetData) IsCmdExistReturns(result1 bool) { | ||
fake.IsCmdExistStub = nil | ||
fake.isCmdExistReturns = struct { | ||
result1 bool | ||
}{result1} | ||
} | ||
|
||
func (fake *FakeCmdSetData) ListCmdSetNames() []string { | ||
fake.listCmdSetNamesMutex.Lock() | ||
fake.listCmdSetNamesArgsForCall = append(fake.listCmdSetNamesArgsForCall, struct{}{}) | ||
fake.listCmdSetNamesMutex.Unlock() | ||
if fake.ListCmdSetNamesStub != nil { | ||
return fake.ListCmdSetNamesStub() | ||
} else { | ||
return fake.listCmdSetNamesReturns.result1 | ||
} | ||
} | ||
|
||
func (fake *FakeCmdSetData) ListCmdSetNamesCallCount() int { | ||
fake.listCmdSetNamesMutex.RLock() | ||
defer fake.listCmdSetNamesMutex.RUnlock() | ||
return len(fake.listCmdSetNamesArgsForCall) | ||
} | ||
|
||
func (fake *FakeCmdSetData) ListCmdSetNamesReturns(result1 []string) { | ||
fake.ListCmdSetNamesStub = nil | ||
fake.listCmdSetNamesReturns = struct { | ||
result1 []string | ||
}{result1} | ||
} | ||
|
||
func (fake *FakeCmdSetData) ClearCmdSets() { | ||
fake.clearCmdSetsMutex.Lock() | ||
fake.clearCmdSetsArgsForCall = append(fake.clearCmdSetsArgsForCall, struct{}{}) | ||
fake.clearCmdSetsMutex.Unlock() | ||
if fake.ClearCmdSetsStub != nil { | ||
fake.ClearCmdSetsStub() | ||
} | ||
} | ||
|
||
func (fake *FakeCmdSetData) ClearCmdSetsCallCount() int { | ||
fake.clearCmdSetsMutex.RLock() | ||
defer fake.clearCmdSetsMutex.RUnlock() | ||
return len(fake.clearCmdSetsArgsForCall) | ||
} | ||
|
||
var _ data.CmdSetData = new(FakeCmdSetData) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package data_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestData(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Data Suite") | ||
} |
Oops, something went wrong.