From 84bf6fea5a85765730c895a6e5667dd1d6ec809e Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 25 Aug 2020 17:46:11 +0300 Subject: [PATCH 1/2] fixed test --- tests/Go.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Go.Tests.ps1 b/tests/Go.Tests.ps1 index 2b0d275..836cdb6 100644 --- a/tests/Go.Tests.ps1 +++ b/tests/Go.Tests.ps1 @@ -15,6 +15,8 @@ BeforeAll { } } +[version]$Version = $env:VERSION + Describe "Go" { It "is available" { "go version" | Should -ReturnZeroExitCode @@ -22,9 +24,9 @@ Describe "Go" { It "version is correct" { $versionOutput = Invoke-Expression -Command "go version" - $finalVersion = ($env:VERSION).ToString(3) + $finalVersion = $Version.ToString(3) If ($Version.Build -eq "0"){ - $finalVersion = ($env:VERSION).ToString(2) + $finalVersion = $Version.ToString(2) } $versionOutput | Should -Match $finalVersion } From d2545be179a0dd5d5a3eea032f5ee590df62fb65 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 25 Aug 2020 17:47:54 +0300 Subject: [PATCH 2/2] fixed tests --- tests/Go.Tests.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Go.Tests.ps1 b/tests/Go.Tests.ps1 index 836cdb6..336182f 100644 --- a/tests/Go.Tests.ps1 +++ b/tests/Go.Tests.ps1 @@ -49,10 +49,10 @@ Describe "Go" { $useGoLogContent | Should -Match "Found in cache" } - Set-Location -Path "source" - $sourceLocation = Get-Location It "Run simple code" { + Set-Location -Path "source" + $sourceLocation = Get-Location $simpleLocation = Join-Path -Path $sourceLocation -ChildPath "simple" Set-Location -Path $simpleLocation "go run simple.go" | Should -ReturnZeroExitCode @@ -61,6 +61,8 @@ Describe "Go" { } It "Run maps code" { + Set-Location -Path "source" + $sourceLocation = Get-Location $mapsLocation = Join-Path -Path $sourceLocation -ChildPath "maps" Set-Location -Path $mapsLocation "go run maps.go" | Should -ReturnZeroExitCode @@ -69,6 +71,8 @@ Describe "Go" { } It "Run methods code" { + Set-Location -Path "source" + $sourceLocation = Get-Location $methodsLocation = Join-Path -Path $sourceLocation -ChildPath "methods" Set-Location -Path $methodsLocation "go run methods.go" | Should -ReturnZeroExitCode