aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/hardware_spec.rb
blob: c5f8daf4e0e65a18a318eec8bdadb66556f04c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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