[macOS] Add Ruby toolcache on arm64 images. (#10768)

Co-authored-by: Erik Bershel <erik-bershel@github.com>
This commit is contained in:
susmitamane
2024-11-22 20:05:31 +05:30
committed by GitHub
parent 26b592de2b
commit 6e8ddff8ff
7 changed files with 64 additions and 70 deletions

View File

@@ -0,0 +1,25 @@
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
Describe "Ruby" {
It "Ruby is available" {
"ruby --version" | Should -ReturnZeroExitCode
}
It "Ruby is installed via HomeBrew" {
Get-ToolPath "ruby" | Should -Not -BeLike "/usr/bin/ruby*"
}
It "Ruby tools are consistent" {
$os = Get-OSVersion
$expectedPrefix = if ($os.IsArm64) { "/opt/homebrew" } else { "/usr/local" }
Get-ToolPath "ruby" | Should -Match "^$expectedPrefix.*"
Get-ToolPath "gem" | Should -Match "^$expectedPrefix.*"
Get-ToolPath "bundler" | Should -Match "^$expectedPrefix.*"
}
It "Ruby gems permissions are valid" {
"gem install bundle" | Should -ReturnZeroExitCode
"gem uninstall bundle" | Should -ReturnZeroExitCode
}
}