File tree 1 file changed +38
-0
lines changed
src/GitVersion.Core.Tests/Configuration
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,44 @@ public void CanProvideConfigForNewBranch()
164
164
config . Branches [ "bug" ] . Tag . ShouldBe ( "bugfix" ) ;
165
165
}
166
166
167
+ [ Test ]
168
+ public void MasterConfigReplacedWithMain ( )
169
+ {
170
+ const string text = @"
171
+ next-version: 2.0.0
172
+ branches:
173
+ master:
174
+ regex: '^master$|^main$'
175
+ tag: beta" ;
176
+ SetupConfigFileContent ( text ) ;
177
+
178
+ var config = configProvider . Provide ( repoPath ) ;
179
+
180
+ config . Branches [ MainBranch ] . Regex . ShouldBe ( "^master$|^main$" ) ;
181
+ config . Branches [ MainBranch ] . Tag . ShouldBe ( "beta" ) ;
182
+ }
183
+
184
+ [ Test ]
185
+ public void MasterConfigReplacedWithMainInSourceBranches ( )
186
+ {
187
+ const string text = @"
188
+ next-version: 2.0.0
189
+ branches:
190
+ breaking:
191
+ regex: breaking[/]
192
+ mode: ContinuousDeployment
193
+ increment: Major
194
+ source-branches: ['master']
195
+ is-release-branch: false" ;
196
+ SetupConfigFileContent ( text ) ;
197
+
198
+ var config = configProvider . Provide ( repoPath ) ;
199
+
200
+ config . Branches [ "breaking" ] . Regex . ShouldBe ( "breaking[/]" ) ;
201
+ config . Branches [ "breaking" ] . SourceBranches . ShouldHaveSingleItem ( ) ;
202
+ config . Branches [ "breaking" ] . SourceBranches . ShouldContain ( MainBranch ) ;
203
+ }
204
+
167
205
[ Test ]
168
206
public void NextVersionCanBeInteger ( )
169
207
{
You can’t perform that action at this time.
0 commit comments