13
13
[ TestFixture ]
14
14
public class ConfigProviderTests
15
15
{
16
- string gitDirectory ;
16
+ string repoPath ;
17
17
IFileSystem fileSystem ;
18
18
19
19
[ SetUp ]
20
20
public void Setup ( )
21
21
{
22
22
fileSystem = new TestFileSystem ( ) ;
23
- gitDirectory = "c:\\ MyGitRepo\\ .git " ;
23
+ repoPath = "c:\\ MyGitRepo" ;
24
24
}
25
25
26
26
[ Test ]
@@ -41,7 +41,7 @@ public void CanReadDocument()
41
41
" ;
42
42
SetupConfigFileContent ( text ) ;
43
43
44
- var config = ConfigurationProvider . Provide ( gitDirectory , fileSystem ) ;
44
+ var config = ConfigurationProvider . Provide ( repoPath , fileSystem ) ;
45
45
config . AssemblyVersioningScheme . ShouldBe ( AssemblyVersioningScheme . MajorMinor ) ;
46
46
config . NextVersion . ShouldBe ( "2.0.0" ) ;
47
47
config . TagPrefix . ShouldBe ( "[vV|version-]" ) ;
@@ -61,7 +61,7 @@ public void CanReadOldDocument()
61
61
release-branch-tag: rc
62
62
" ;
63
63
SetupConfigFileContent ( text ) ;
64
- var error = Should . Throw < OldConfigurationException > ( ( ) => ConfigurationProvider . Provide ( gitDirectory , fileSystem ) ) ;
64
+ var error = Should . Throw < OldConfigurationException > ( ( ) => ConfigurationProvider . Provide ( repoPath , fileSystem ) ) ;
65
65
error . Message . ShouldContainWithoutWhitespace ( @"GitVersionConfig.yaml contains old configuration, please fix the following errors:
66
66
assemblyVersioningScheme has been replaced by assembly-versioning-scheme
67
67
develop-branch-tag has been replaced by branch specific configuration.See https://github.com/ParticularLabs/GitVersion/wiki/Branch-Specific-Configuration
@@ -79,7 +79,7 @@ public void OverwritesDefaultsWithProvidedConfig()
79
79
tag: dev" ;
80
80
SetupConfigFileContent ( text ) ;
81
81
var defaultConfig = new Config ( ) ;
82
- var config = ConfigurationProvider . Provide ( gitDirectory , fileSystem ) ;
82
+ var config = ConfigurationProvider . Provide ( repoPath , fileSystem ) ;
83
83
84
84
config . NextVersion . ShouldBe ( "2.0.0" ) ;
85
85
config . AssemblyVersioningScheme . ShouldBe ( defaultConfig . AssemblyVersioningScheme ) ;
@@ -97,7 +97,7 @@ public void CanProvideConfigForNewBranch()
97
97
bug[/-]:
98
98
tag: bugfix" ;
99
99
SetupConfigFileContent ( text ) ;
100
- var config = ConfigurationProvider . Provide ( gitDirectory , fileSystem ) ;
100
+ var config = ConfigurationProvider . Provide ( repoPath , fileSystem ) ;
101
101
102
102
config . Branches [ "bug[/-]" ] . Tag . ShouldBe ( "bugfix" ) ;
103
103
}
@@ -106,7 +106,7 @@ public void CanProvideConfigForNewBranch()
106
106
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
107
107
public void CanWriteOutEffectiveConfiguration ( )
108
108
{
109
- var config = ConfigurationProvider . GetEffectiveConfigAsString ( gitDirectory , fileSystem ) ;
109
+ var config = ConfigurationProvider . GetEffectiveConfigAsString ( repoPath , fileSystem ) ;
110
110
111
111
Approvals . Verify ( config ) ;
112
112
}
@@ -116,7 +116,7 @@ public void CanReadDefaultDocument()
116
116
{
117
117
const string text = "" ;
118
118
SetupConfigFileContent ( text ) ;
119
- var config = ConfigurationProvider . Provide ( gitDirectory , fileSystem ) ;
119
+ var config = ConfigurationProvider . Provide ( repoPath , fileSystem ) ;
120
120
config . AssemblyVersioningScheme . ShouldBe ( AssemblyVersioningScheme . MajorMinorPatch ) ;
121
121
config . Branches [ "develop" ] . Tag . ShouldBe ( "unstable" ) ;
122
122
config . Branches [ "release[/-]" ] . Tag . ShouldBe ( "beta" ) ;
@@ -156,6 +156,6 @@ public void VerifyAliases()
156
156
157
157
void SetupConfigFileContent ( string text )
158
158
{
159
- fileSystem . WriteAllText ( Path . Combine ( Directory . GetParent ( gitDirectory ) . FullName , "GitVersionConfig.yaml" ) , text ) ;
159
+ fileSystem . WriteAllText ( Path . Combine ( repoPath , "GitVersionConfig.yaml" ) , text ) ;
160
160
}
161
161
}
0 commit comments