1
0
Fork 0
mirror of https://code.forgejo.org/actions/go-versions synced 2025-06-12 05:14:13 +02:00

fixed test

This commit is contained in:
Nikita Bykov 2020-08-25 17:46:11 +03:00
parent 534826cfa6
commit 84bf6fea5a

View file

@ -15,6 +15,8 @@ BeforeAll {
} }
} }
[version]$Version = $env:VERSION
Describe "Go" { Describe "Go" {
It "is available" { It "is available" {
"go version" | Should -ReturnZeroExitCode "go version" | Should -ReturnZeroExitCode
@ -22,9 +24,9 @@ Describe "Go" {
It "version is correct" { It "version is correct" {
$versionOutput = Invoke-Expression -Command "go version" $versionOutput = Invoke-Expression -Command "go version"
$finalVersion = ($env:VERSION).ToString(3) $finalVersion = $Version.ToString(3)
If ($Version.Build -eq "0"){ If ($Version.Build -eq "0"){
$finalVersion = ($env:VERSION).ToString(2) $finalVersion = $Version.ToString(2)
} }
$versionOutput | Should -Match $finalVersion $versionOutput | Should -Match $finalVersion
} }