diff --git a/Library/Homebrew/test/test_bucket.rb b/Library/Homebrew/test/test_bucket.rb index cc615466b9..39dd41dab8 100644 --- a/Library/Homebrew/test/test_bucket.rb +++ b/Library/Homebrew/test/test_bucket.rb @@ -101,18 +101,6 @@ class BeerTasting < Test::Unit::TestCase assert_raises(FormulaUnavailableError) { ARGV.formulae } end - # 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 - def test_brew_h nostdout do assert_nothing_raised do diff --git a/Library/Homebrew/test/test_hardware.rb b/Library/Homebrew/test/test_hardware.rb new file mode 100644 index 0000000000..a753d0cf8d --- /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 diff --git a/Library/Homebrew/test/tests b/Library/Homebrew/test/tests index ea5cf6cea6..6653b10a9f 100755 --- a/Library/Homebrew/test/tests +++ b/Library/Homebrew/test/tests @@ -9,6 +9,9 @@ # Bulk of the tests ruby unittest.rb $* +# Test hardware sniffers +ruby test_hardware.rb $* + # Test formula installs ruby test_formula_install.rb $* diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb index cfe8bc1286..e93fd7b39c 100755 --- a/Library/Homebrew/test/unittest.rb +++ b/Library/Homebrew/test/unittest.rb @@ -23,13 +23,11 @@ Dir.chdir HOMEBREW_PREFIX at_exit { HOMEBREW_PREFIX.parent.rmtree } require 'utils' -require 'hardware' require 'formula' require 'download_strategy' require 'keg' require 'utils' require 'brew.h' -require 'hardware' # for some reason our utils.rb safe_system behaves completely differently # during these tests. This is worrying for sure.