File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,15 @@ func (p Provider) raw (s string) string {
113
113
114
114
className , ok := rawProviders [parts [1 ]]
115
115
if ! ok {
116
- logger .Error (parts [1 ] + " is not a supported" )
116
+ logger .Error (parts [1 ] + " is not a supported provider " )
117
117
return ""
118
118
}
119
119
120
120
class := reflect .ValueOf (className )
121
121
methodName := strings .Split (parts [2 ], "(" )[0 ]
122
122
method := class .MethodByName (methodName )
123
123
if ! method .IsValid () {
124
- // TODO: Cover this with logging
124
+ logger . Error ( parts [ 2 ] + " is not a valid method" )
125
125
return ""
126
126
}
127
127
Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ func TestGet(t *testing.T) {
37
37
}
38
38
39
39
_ = provider .Get ("faker.Whoops1" )
40
- if hook .LastEntry ().Message != "Whoops1 is not a supported" {
40
+ if hook .LastEntry ().Message != "Whoops1 is not a supported provider " {
41
41
t .Errorf ("Unsupported provider not handled correctly" )
42
42
}
43
43
44
- r6 : = provider .Get ("faker.Number().Whoops2()" )
45
- if r6 != "" {
46
- t .Errorf ("Got a value and was expecting empty string " )
44
+ _ = provider .Get ("faker.Number().Whoops2()" )
45
+ if hook . LastEntry (). Message != "Whoops2() is not a valid method " {
46
+ t .Errorf ("Unsupported method not handled correctly " )
47
47
}
48
48
49
49
r7 := provider .Get ("faker.Internet().Slug" )
You can’t perform that action at this time.
0 commit comments