diff options
| author | Adam Vandenberg | 2010-02-18 12:00:07 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2010-04-06 08:27:10 -0700 |
| commit | a5cbf945962b7a177b3d080bf100dab65757b366 (patch) | |
| tree | 60e3f902247c93a63c55d05ef6f8c198c5149c59 /Library/Homebrew/test | |
| parent | 3123720608078375a1e141d1db1f32f42a48026f (diff) | |
| download | brew-a5cbf945962b7a177b3d080bf100dab65757b366.tar.bz2 | |
Move hardware detection tests to separate file.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_bucket.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_hardware.rb | 21 | ||||
| -rwxr-xr-x | Library/Homebrew/test/tests | 3 | ||||
| -rwxr-xr-x | Library/Homebrew/test/unittest.rb | 2 |
4 files changed, 24 insertions, 14 deletions
diff --git a/Library/Homebrew/test/test_bucket.rb b/Library/Homebrew/test/test_bucket.rb index cc615466b..39dd41dab 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 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 diff --git a/Library/Homebrew/test/tests b/Library/Homebrew/test/tests index ea5cf6cea..6653b10a9 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 cfe8bc128..e93fd7b39 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. |
