Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rylan12 committed Jun 25, 2024
1 parent b7321db commit a4ea7d8
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 37 deletions.
12 changes: 6 additions & 6 deletions Library/Homebrew/test/formula_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@

build_values_with_no_installed_alias = [
BuildOptions.new(Options.new, f.options),
Tab.new(source: { "path" => f.path.to_s }),
Tab.new({ source: { "path" => f.path.to_s } }),
]
build_values_with_no_installed_alias.each do |build|
f.build = build
Expand All @@ -196,7 +196,7 @@
CoreTap.instance.alias_dir.mkpath
FileUtils.ln_sf f.path, alias_path

f.build = Tab.new(source: { "path" => alias_path.to_s })
f.build = Tab.new({ source: { "path" => alias_path.to_s } })

expect(f.installed_alias_path).to eq(alias_path)
expect(f.installed_alias_name).to eq(alias_name)
Expand All @@ -215,7 +215,7 @@

build_values_with_no_installed_alias = [
BuildOptions.new(Options.new, f.options),
Tab.new(source: { "path" => f.path.to_s }),
Tab.new({ source: { "path" => f.path.to_s } }),
]
build_values_with_no_installed_alias.each do |build|
f.build = build
Expand All @@ -232,7 +232,7 @@
tap.alias_dir.mkpath
FileUtils.ln_sf f.path, alias_path

f.build = Tab.new(source: { "path" => alias_path.to_s })
f.build = Tab.new({ source: { "path" => alias_path.to_s } })

expect(f.installed_alias_path).to eq(alias_path)
expect(f.installed_alias_name).to eq(alias_name)
Expand Down Expand Up @@ -435,7 +435,7 @@
f = formula(alias_path:) do
url "foo-1.0"
end
f.build = Tab.new(source: { "path" => source_path.to_s })
f.build = Tab.new({ source: { "path" => source_path.to_s } })

expect(f.alias_path).to eq(alias_path)
expect(f.installed_alias_path).to be_nil
Expand All @@ -448,7 +448,7 @@
f = formula(alias_path:) do
url "foo-1.0"
end
f.build = Tab.new(source: { "path" => source_path.to_s })
f.build = Tab.new({ source: { "path" => source_path.to_s } })
CoreTap.instance.alias_dir.mkpath
FileUtils.ln_sf f.path, source_path

Expand Down
53 changes: 53 additions & 0 deletions Library/Homebrew/test/support/fixtures/cask_receipt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"homebrew_version": "4.3.7",
"loaded_from_api": false,
"caskfile_only": true,
"installed_as_dependency": false,
"installed_on_request": true,
"time": 1719289256,
"runtime_dependencies": {
"cask": [
{
"full_name": "bar",
"version": "2.0",
"declared_directly": true
}
],
"formula": [
{
"full_name": "baz",
"version": "3.0",
"revision": 0,
"pkg_version": "3.0",
"declared_directly": true
}
],
"macos": {
">=": [
"12"
]
}
},
"source": {
"path": "/opt/homebrew/Library/Taps/homebrew/homebrew-cask/Casks/f/foo.rb",
"tap": "homebrew/cask",
"tap_git_head": "8b79aa759500f0ffdf65a23e12950cbe3bf8fe17",
"version": "1.2.3"
},
"arch": "arm64",
"uninstall_artifacts": [
{
"app": [
"Foo.app"
]
}
],
"built_on": {
"os": "Macintosh",
"os_version": "macOS 14",
"cpu_family": "arm_firestorm_icestorm",
"xcode": "15.4",
"clt": "15.3.0.0.1.1708646388",
"preferred_perl": "5.34"
}
}
Loading

0 comments on commit a4ea7d8

Please sign in to comment.