aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/hardware_spec.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-14 19:26:29 +0100
committerMarkus Reiter2017-02-15 02:07:57 +0100
commit8d7d41dc852e9a6bd51aa36b4142a372681bae39 (patch)
tree2c6d334db0f82dff274941c709066ef27c6d9e35 /Library/Homebrew/test/hardware_spec.rb
parente116ba196e2834025c713a2a566e0e150907d6d0 (diff)
downloadbrew-8d7d41dc852e9a6bd51aa36b4142a372681bae39.tar.bz2
Convert Hardware test to spec.
Diffstat (limited to 'Library/Homebrew/test/hardware_spec.rb')
-rw-r--r--Library/Homebrew/test/hardware_spec.rb40
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