diff options
Diffstat (limited to 'Library/Homebrew/test/hardware_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/hardware_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Library/Homebrew/test/hardware_spec.rb b/Library/Homebrew/test/hardware_spec.rb new file mode 100644 index 000000000..c5f8daf4e --- /dev/null +++ b/Library/Homebrew/test/hardware_spec.rb @@ -0,0 +1,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 |
