mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
41 lines
907 B
Ruby
41 lines
907 B
Ruby
require "hardware"
|
|
|
|
module Hardware
|
|
describe CPU do
|
|
describe "::type" do
|
|
it "returns the current CPU's type as a symbol, or :dunno if it cannot be detected" do
|
|
expect(
|
|
[
|
|
:intel,
|
|
:ppc,
|
|
:dunno,
|
|
],
|
|
).to include(described_class.type)
|
|
end
|
|
end
|
|
|
|
describe "::family" do
|
|
it "returns the current CPU's family name as a symbol, or :dunno if it cannot be detected" do
|
|
skip "Needs an Intel CPU." unless described_class.intel?
|
|
|
|
expect(
|
|
[
|
|
:core,
|
|
:core2,
|
|
:penryn,
|
|
:nehalem,
|
|
:arrandale,
|
|
:sandybridge,
|
|
:ivybridge,
|
|
:haswell,
|
|
:broadwell,
|
|
:skylake,
|
|
:kabylake,
|
|
:dunno,
|
|
],
|
|
).to include(described_class.family)
|
|
end
|
|
end
|
|
end
|
|
end
|