aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_hardware.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2010-02-18 12:00:07 -0800
committerAdam Vandenberg2010-04-06 08:27:10 -0700
commita5cbf945962b7a177b3d080bf100dab65757b366 (patch)
tree60e3f902247c93a63c55d05ef6f8c198c5149c59 /Library/Homebrew/test/test_hardware.rb
parent3123720608078375a1e141d1db1f32f42a48026f (diff)
downloadbrew-a5cbf945962b7a177b3d080bf100dab65757b366.tar.bz2
Move hardware detection tests to separate file.
Diffstat (limited to 'Library/Homebrew/test/test_hardware.rb')
-rw-r--r--Library/Homebrew/test/test_hardware.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_hardware.rb b/Library/Homebrew/test/test_hardware.rb
new file mode 100644
index 000000000..a753d0cf8
--- /dev/null
+++ b/Library/Homebrew/test/test_hardware.rb
@@ -0,0 +1,21 @@
+require 'testing_env'
+
+require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
+ARGV.extend(HomebrewArgvExtension)
+
+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].include?(Hardware.intel_family)
+ end
+ end
+end \ No newline at end of file