Skip to content

Commit 0ca358d

Browse files
committed
chore: switch test names from space to hyphen separated (#140)
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
1 parent 8eb7d2a commit 0ca358d

19 files changed

Lines changed: 502 additions & 502 deletions

cmd/mock/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
var mainTestCases = map[string]test.MainParams{
10-
"no mocks": {
10+
"no-mocks": {
1111
Args: []string{"mock"},
1212
Env: []string{},
1313
ExitCode: 0,

gock/controller_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ type ControllerParams struct {
1818
}
1919

2020
var controllerTestCases = map[string]ControllerParams{
21-
"match with bar": {
21+
"match-with-bar": {
2222
url: "http://foo.com/bar",
2323
expectMatch: test.Success,
2424
},
25-
"match with baz": {
25+
"match-with-baz": {
2626
url: "http://foo.com/baz",
2727
expectMatch: test.Success,
2828
},
29-
"missing host": {
29+
"missing-host": {
3030
url: "http://bar.com/baz",
3131
expectError: gock.ErrCannotMatch,
3232
},
33-
"missing path": {
33+
"missing-path": {
3434
url: "http://foo.com/foo",
3535
expectError: gock.ErrCannotMatch,
3636
},
37-
"missing schema": {
37+
"missing-schema": {
3838
url: "https://foo.com/bar",
3939
expectError: assert.AnError,
4040
},

gock/store_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,21 +198,21 @@ type MatchParams struct {
198198
}
199199

200200
var matchTestCases = map[string]MatchParams{
201-
"match with bar": {
201+
"match-with-bar": {
202202
url: "http://foo.com/bar",
203203
expectMatch: true,
204204
},
205-
"match with baz": {
205+
"match-with-baz": {
206206
url: "http://foo.com/baz",
207207
expectMatch: true,
208208
},
209-
"missing host": {
209+
"missing-host": {
210210
url: "http://bar.com/baz",
211211
},
212-
"missing path": {
212+
"missing-path": {
213213
url: "http://foo.com/foo",
214214
},
215-
"missing schema": {
215+
"missing-schema": {
216216
url: "https://foo.com/bar",
217217
expectError: assert.AnError,
218218
},

internal/maps/maps_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ type CopyParams struct {
1515
}
1616

1717
var copyTestCases = map[string]CopyParams{
18-
"empty map": {
18+
"empty-map": {
1919
input: map[string]int{},
2020
expect: map[string]int{},
2121
},
22-
"single key-value pair": {
22+
"single-key-value-pair": {
2323
input: map[string]int{"a": 1},
2424
expect: map[string]int{"a": 1},
2525
},
26-
"multiple key-value pairs": {
26+
"multiple-key-value-pairs": {
2727
input: map[string]int{"a": 1, "b": 2, "c": 3},
2828
expect: map[string]int{"a": 1, "b": 2, "c": 3},
2929
},
@@ -47,22 +47,22 @@ type AddParams struct {
4747
}
4848

4949
var addTestCases = map[string]AddParams{
50-
"no sources": {
50+
"no-sources": {
5151
target: map[string]int{"a": 1},
5252
sources: []map[string]int{},
5353
expect: map[string]int{"a": 1},
5454
},
55-
"single source": {
55+
"single-source": {
5656
target: map[string]int{"a": 1},
5757
sources: []map[string]int{{"b": 2}},
5858
expect: map[string]int{"a": 1, "b": 2},
5959
},
60-
"multiple sources with no conflicts": {
60+
"multiple-sources-with-no-conflicts": {
6161
target: map[string]int{"a": 1},
6262
sources: []map[string]int{{"b": 2}, {"c": 3}},
6363
expect: map[string]int{"a": 1, "b": 2, "c": 3},
6464
},
65-
"multiple sources with conflicts": {
65+
"multiple-sources-with-conflicts": {
6666
target: map[string]int{"a": 1},
6767
sources: []map[string]int{{"a": 2}, {"a": 3, "b": 4}},
6868
expect: map[string]int{"a": 3, "b": 4},

internal/mock/builder_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ type FileBuilderParams struct {
3131
}
3232

3333
var fileBuilderTestCases = map[string]FileBuilderParams{
34-
"import double": {
34+
"import-double": {
3535
setup: test.Panic(NewErrAliasConflict(
3636
importMockTest, pathTest)),
3737
target: targetMockIFace,
3838
imports: []*Import{importMockTest, importMockTest},
3939
},
4040

41-
"import illegal": {
41+
"import-illegal": {
4242
setup: test.Panic(NewErrIllegalImport(importIllegal)),
4343
target: targetMockIFace,
4444
imports: []*Import{importIllegal},
4545
},
4646

47-
"no imports": {
47+
"no-imports": {
4848
target: targetMockIFace,
4949
mocks: []*Mock{{
5050
Methods: methodsLoadIFace,
@@ -60,7 +60,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
6060
},
6161
},
6262

63-
"others imported": {
63+
"others-imported": {
6464
target: targetMockIFace,
6565
imports: []*Import{
6666
ImportReflect, ImportGomock, ImportMock,
@@ -80,7 +80,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
8080
},
8181
},
8282

83-
"pre imported": {
83+
"pre-imported": {
8484
target: targetMockIFace,
8585
imports: []*Import{
8686
ImportReflect, importTest, importMock, importMockTest,
@@ -99,7 +99,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
9999
},
100100
},
101101

102-
"alias imported": {
102+
"alias-imported": {
103103
target: targetMockIFace,
104104
imports: []*Import{importAlias(pkgTest)},
105105
mocks: []*Mock{{
@@ -118,7 +118,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
118118
},
119119
},
120120

121-
"package imported": {
121+
"package-imported": {
122122
target: targetMockIFace,
123123
imports: []*Import{
124124
importAlias(pkgTest),
@@ -143,7 +143,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
143143
},
144144
},
145145

146-
"internal imported": {
146+
"internal-imported": {
147147
target: targetMockIFace,
148148
imports: []*Import{
149149
importAlias(pkgTest),
@@ -168,7 +168,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
168168
},
169169
},
170170

171-
"organization imported": {
171+
"organization-imported": {
172172
target: targetMockIFace,
173173
imports: []*Import{
174174
importAlias(pkgTest),
@@ -197,7 +197,7 @@ var fileBuilderTestCases = map[string]FileBuilderParams{
197197
},
198198
},
199199

200-
"import conflict": {
200+
"import-conflict": {
201201
setup: test.Panic(NewErrAliasConflict(&Import{
202202
Alias: aliasGitHub, Path: pathTest,
203203
}, pathTest)),

internal/mock/generate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var generateTestCases = map[string]GenerateParams{
4141
expectFile: expectIFace,
4242
},
4343

44-
"failure parsing": {
44+
"failure-parsing": {
4545
file: filepath.Join(testDirGenerate, MockFileDefault),
4646
args: []string{pathUnknown},
4747
expectStderr: NewErrArgFailure(3, ".",
@@ -54,7 +54,7 @@ var generateTestCases = map[string]GenerateParams{
5454
expectCode: 1,
5555
},
5656

57-
"failure opening": {
57+
"failure-opening": {
5858
file: fileFailure,
5959
args: []string{pathTest},
6060
expectStderr: NewErrFileOpening(fileFailure, &fs.PathError{

0 commit comments

Comments
 (0)