Skip to content

Commit 533bed9

Browse files
committed
Code factorization
1 parent 86895d9 commit 533bed9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Release.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Release {
5050
.OUTPUTS
5151
The download URL.
5252
#>
53-
[uri] Url() {
53+
[uri] GetUrl() {
5454
return "https://archive.apache.org/dist/ant/binaries/apache-ant-$($this.Version)-bin.zip"
5555
}
5656

src/Setup.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Setup {
4545
#>
4646
[string] Download([bool] $OptionalTasks) {
4747
$file = New-TemporaryFile
48-
Invoke-WebRequest $this.Release.Url() -OutFile $file
48+
Invoke-WebRequest $this.Release.GetUrl() -OutFile $file
4949

5050
$directory = Join-Path ([Path]::GetTempPath()) (New-Guid)
5151
Expand-Archive $file $directory -Force

test/Release.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Describe "Release" {
2727
}
2828
}
2929

30-
Context "Url" {
30+
Context "GetUrl" {
3131
It "should return the URL of the Ant archive" {
32-
$existingRelease.Url() | Should -BeExactly "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.15-bin.zip"
33-
$nonExistingRelease.Url() | Should -BeExactly "https://archive.apache.org/dist/ant/binaries/apache-ant-666.6.6-bin.zip"
32+
$existingRelease.GetUrl() | Should -BeExactly "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.15-bin.zip"
33+
$nonExistingRelease.GetUrl() | Should -BeExactly "https://archive.apache.org/dist/ant/binaries/apache-ant-666.6.6-bin.zip"
3434
}
3535
}
3636

0 commit comments

Comments
 (0)