Only define intel family test on intel CPU

This commit is contained in:
Jack Nagel 2014-06-13 16:32:26 -05:00
parent 1b9aed4025
commit 4b07dbbf78

View File

@ -2,16 +2,12 @@ require 'testing_env'
require 'hardware'
class HardwareTests < Test::Unit::TestCase
# these will raise if we don't recognise your mac, but that prolly
# indicates something went wrong rather than we don't know
def test_hardware_cpu_type
assert [:intel, :ppc].include?(Hardware::CPU.type)
end
def test_hardware_intel_family
if Hardware::CPU.type == :intel
assert [:core, :core2, :penryn, :nehalem,
:arrandale, :sandybridge, :ivybridge, :haswell].include?(Hardware::CPU.family)
end
end
families = [:core, :core2, :penryn, :nehalem, :arrandale, :sandybridge, :ivybridge, :haswell]
assert families.include?(Hardware::CPU.family)
end if Hardware::CPU.intel?
end