Fix test
This commit is contained in:
parent
3a732460e9
commit
e176159b23
@ -15,6 +15,7 @@ module Cask
|
|||||||
tab.uninstall_flight_blocks = cask.uninstall_flight_blocks?
|
tab.uninstall_flight_blocks = cask.uninstall_flight_blocks?
|
||||||
tab.runtime_dependencies = Tab.runtime_deps_hash(cask, cask.depends_on)
|
tab.runtime_dependencies = Tab.runtime_deps_hash(cask, cask.depends_on)
|
||||||
tab.source["version"] = cask.version.to_s
|
tab.source["version"] = cask.version.to_s
|
||||||
|
tab.source["path"] = cask.sourcefile_path.to_s
|
||||||
tab.uninstall_artifacts = cask.artifacts_list(uninstall_only: true)
|
tab.uninstall_artifacts = cask.artifacts_list(uninstall_only: true)
|
||||||
|
|
||||||
tab
|
tab
|
||||||
|
|||||||
@ -40,7 +40,6 @@ class AbstractTab
|
|||||||
"time" => Time.now.to_i,
|
"time" => Time.now.to_i,
|
||||||
"arch" => Hardware::CPU.arch,
|
"arch" => Hardware::CPU.arch,
|
||||||
"source" => {
|
"source" => {
|
||||||
"path" => formula_or_cask.sourcefile_path.to_s,
|
|
||||||
"tap" => formula_or_cask.tap&.name,
|
"tap" => formula_or_cask.tap&.name,
|
||||||
"tap_git_head" => (formula_or_cask.tap&.installed? ? formula_or_cask.tap.git_head : nil),
|
"tap_git_head" => (formula_or_cask.tap&.installed? ? formula_or_cask.tap.git_head : nil),
|
||||||
},
|
},
|
||||||
@ -147,6 +146,7 @@ class Tab < AbstractTab
|
|||||||
tab.aliases = formula.aliases
|
tab.aliases = formula.aliases
|
||||||
tab.runtime_dependencies = Tab.runtime_deps_hash(formula, runtime_deps)
|
tab.runtime_dependencies = Tab.runtime_deps_hash(formula, runtime_deps)
|
||||||
tab.source["spec"] = formula.active_spec_sym.to_s
|
tab.source["spec"] = formula.active_spec_sym.to_s
|
||||||
|
tab.source["path"] = formula.specified_path.to_s
|
||||||
tab.source["versions"] = {
|
tab.source["versions"] = {
|
||||||
"stable" => formula.stable&.version&.to_s,
|
"stable" => formula.stable&.version&.to_s,
|
||||||
"head" => formula.head&.version&.to_s,
|
"head" => formula.head&.version&.to_s,
|
||||||
|
|||||||
@ -212,6 +212,10 @@ RSpec.describe Cask::Tab, :cask do
|
|||||||
describe "::create" do
|
describe "::create" do
|
||||||
it "creates a cask Tab" do
|
it "creates a cask Tab" do
|
||||||
cask = Cask::CaskLoader.load("local-caffeine")
|
cask = Cask::CaskLoader.load("local-caffeine")
|
||||||
|
expected_artifacts = [
|
||||||
|
{ app: ["Caffeine.app"] },
|
||||||
|
{ zap: [{ trash: "#{TEST_FIXTURE_DIR}/cask/caffeine/org.example.caffeine.plist" }] },
|
||||||
|
]
|
||||||
|
|
||||||
tab = described_class.create(cask)
|
tab = described_class.create(cask)
|
||||||
expect(tab).not_to be_loaded_from_api
|
expect(tab).not_to be_loaded_from_api
|
||||||
@ -225,7 +229,7 @@ RSpec.describe Cask::Tab, :cask do
|
|||||||
"version" => "1.2.3",
|
"version" => "1.2.3",
|
||||||
})
|
})
|
||||||
expect(tab.runtime_dependencies).to eq({})
|
expect(tab.runtime_dependencies).to eq({})
|
||||||
expect(tab.uninstall_artifacts).to eq([{ app: ["Caffeine.app"] }])
|
expect(tab.uninstall_artifacts).to eq(expected_artifacts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user