Skip to content

Commit

Permalink
Merge pull request #2013 from reitermarkus/spec-hardware
Browse files Browse the repository at this point in the history
Convert Hardware test to spec.
  • Loading branch information
reitermarkus authored Feb 15, 2017
2 parents 3babab2 + 8d7d41d commit 69d1ced
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 15 deletions.
40 changes: 40 additions & 0 deletions Library/Homebrew/test/hardware_spec.rb
Original file line number Diff line number Diff line change
@@ -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
15 changes: 0 additions & 15 deletions Library/Homebrew/test/hardware_test.rb

This file was deleted.

0 comments on commit 69d1ced

Please sign in to comment.