2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-04-14 03:01:33 +02:00
|
|
|
require "hardware"
|
|
|
|
|
|
|
|
describe Hardware::CPU do
|
|
|
|
describe "::type" do
|
|
|
|
let(:cpu_types) {
|
|
|
|
[
|
2019-03-08 14:32:40 +11:00
|
|
|
:arm,
|
2018-04-14 03:01:33 +02:00
|
|
|
:intel,
|
2019-03-08 14:32:40 +11:00
|
|
|
:ppc,
|
2018-04-14 03:01:33 +02:00
|
|
|
:dunno,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
it "returns the current CPU's type as a symbol, or :dunno if it cannot be detected" do
|
|
|
|
expect(cpu_types).to include(described_class.type)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "::family" do
|
|
|
|
let(:cpu_families) {
|
|
|
|
[
|
2020-11-06 15:33:29 +01:00
|
|
|
:arm_vortex_tempest,
|
2019-03-08 14:32:40 +11:00
|
|
|
:arrandale,
|
|
|
|
:atom,
|
|
|
|
:broadwell,
|
2018-04-14 03:01:33 +02:00
|
|
|
:core,
|
|
|
|
:core2,
|
2019-03-08 14:32:40 +11:00
|
|
|
:dothan,
|
|
|
|
:haswell,
|
2020-06-20 14:14:56 +08:00
|
|
|
:icelake,
|
2019-03-08 14:32:40 +11:00
|
|
|
:ivybridge,
|
|
|
|
:kabylake,
|
|
|
|
:merom,
|
2018-04-14 03:01:33 +02:00
|
|
|
:nehalem,
|
2019-03-08 14:32:40 +11:00
|
|
|
:penryn,
|
|
|
|
:prescott,
|
|
|
|
:presler,
|
2018-04-14 03:01:33 +02:00
|
|
|
:sandybridge,
|
|
|
|
:skylake,
|
2019-03-08 14:32:40 +11:00
|
|
|
:westmere,
|
2018-04-14 03:01:33 +02:00
|
|
|
:dunno,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
it "returns the current CPU's family name as a symbol, or :dunno if it cannot be detected" do
|
|
|
|
expect(cpu_families).to include described_class.family
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|