File tree Expand file tree Collapse file tree 3 files changed +17
-37
lines changed
Expand file tree Collapse file tree 3 files changed +17
-37
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,6 @@ public class InstallReleaseCommand: PSCmdlet {
3030 /// </summary>
3131 protected override void ProcessRecord ( ) {
3232 var release = ParameterSetName == "InputObject" ? InputObject : new Release ( Version ) ;
33- // TODO WriteObject(new Setup(release).Install(OptionalTasks));
33+ WriteObject ( new Setup ( release ) . Install ( OptionalTasks ) . GetAwaiter ( ) . GetResult ( ) ) ;
3434 }
3535}
Original file line number Diff line number Diff line change @@ -7,11 +7,25 @@ namespace Belin.SetupAnt;
77[ TestClass ]
88public sealed class SetupTests ( TestContext testContext ) {
99
10+ [ ClassInitialize ]
11+ public static void ClassInitialize ( TestContext testContext ) {
12+ if ( string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "GITHUB_ENV" ) ) ) Environment . SetEnvironmentVariable ( "GITHUB_ENV" , "var/GitHub-Env.txt" ) ;
13+ if ( string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "GITHUB_PATH" ) ) ) Environment . SetEnvironmentVariable ( "GITHUB_PATH" , "var/GitHub-Path.txt" ) ;
14+ }
15+
1016 [ TestMethod ]
11- public void Download ( ) {
17+ public async Task Download ( ) {
18+ var path = await new Setup ( Release . Latest ) . Download ( optionalTasks : true , testContext . CancellationToken ) ;
19+ IsTrue ( File . Exists ( Path . Join ( path , "bin" , OperatingSystem . IsWindows ( ) ? "ant.cmd" : "ant" ) ) ) ;
20+
21+ var jars = Directory . EnumerateFiles ( Path . Join ( path , "lib" ) , "*.jar" ) ;
22+ HasCount ( 1 , jars . Where ( jar => Path . GetFileName ( jar ) . StartsWith ( "ivy-" ) ) ) ;
1223 }
1324
1425 [ TestMethod ]
15- public void Install ( ) {
26+ public async Task Install ( ) {
27+ var path = await new Setup ( Release . Latest ) . Install ( optionalTasks : false , testContext . CancellationToken ) ;
28+ AreEqual ( path , Environment . GetEnvironmentVariable ( "ANT_HOME" ) ) ;
29+ Contains ( path , Environment . GetEnvironmentVariable ( "PATH" ) ! ) ;
1630 }
1731}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments