Skip to content

Commit 69d1ced

Browse files
authored
Merge pull request #2013 from reitermarkus/spec-hardware
Convert Hardware test to spec.
2 parents 3babab2 + 8d7d41d commit 69d1ced

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
require "hardware"
2+
3+
module Hardware
4+
describe CPU do
5+
describe "::type" do
6+
it "returns the current CPU's type as a symbol, or :dunno if it cannot be detected" do
7+
expect(
8+
[
9+
:intel,
10+
:ppc,
11+
:dunno,
12+
],
13+
).to include(described_class.type)
14+
end
15+
end
16+
17+
describe "::family" do
18+
it "returns the current CPU's family name as a symbol, or :dunno if it cannot be detected" do
19+
skip "Needs an Intel CPU." unless described_class.intel?
20+
21+
expect(
22+
[
23+
:core,
24+
:core2,
25+
:penryn,
26+
:nehalem,
27+
:arrandale,
28+
:sandybridge,
29+
:ivybridge,
30+
:haswell,
31+
:broadwell,
32+
:skylake,
33+
:kabylake,
34+
:dunno,
35+
],
36+
).to include(described_class.family)
37+
end
38+
end
39+
end
40+
end

Library/Homebrew/test/hardware_test.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)