@@ -28,6 +28,15 @@ import (
28
28
"testing"
29
29
)
30
30
31
+ func Test_supported_vcs (t * testing.T ) {
32
+ for _ , name := range []string {"git" , "p4" } {
33
+ t .Run (name , func (t * testing.T ) {
34
+ _ , err := InitVCS (name , "" )
35
+ assert .NotEqual (t , reflect .TypeOf (& UnsupportedVCSError {}), reflect .TypeOf (err ))
36
+ })
37
+ }
38
+ }
39
+
31
40
func Test_vcs_factory_returns_an_error_when_vcs_is_not_supported (t * testing.T ) {
32
41
v , err := InitVCS ("unknown-vcs" , "" )
33
42
assert .IsType (t , & UnsupportedVCSError {}, err )
@@ -38,13 +47,3 @@ func Test_unsupported_vcs_message_format(t *testing.T) {
38
47
err := UnsupportedVCSError {"some-vcs" }
39
48
assert .Equal (t , "VCS not supported: \" some-vcs\" " , err .Error ())
40
49
}
41
-
42
- func Test_vcs_factory_supports_git (t * testing.T ) {
43
- _ , err := InitVCS ("git" , "" )
44
- assert .NotEqual (t , reflect .TypeOf (& UnsupportedVCSError {}), reflect .TypeOf (err ))
45
- }
46
-
47
- func Test_vcs_factory_supports_p4 (t * testing.T ) {
48
- _ , err := InitVCS ("p4" , "" )
49
- assert .NotEqual (t , reflect .TypeOf (& UnsupportedVCSError {}), reflect .TypeOf (err ))
50
- }
0 commit comments