aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorAdam Vandenberg2010-03-08 22:10:12 -0800
committerAdam Vandenberg2010-04-06 08:27:11 -0700
commit3473320bc064e61015acfbdee8b6f6c19a5c07d8 (patch)
treeda14e7db4a027c19a4652a93834dc7eb342932c9 /Library/Homebrew/test
parent6bb6c161841a9a54a4219a303d43979884683c75 (diff)
downloadhomebrew-3473320bc064e61015acfbdee8b6f6c19a5c07d8.tar.bz2
Move utils tests to separate file.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_bucket.rb19
-rw-r--r--Library/Homebrew/test/test_utils.rb30
-rwxr-xr-xLibrary/Homebrew/test/tests3
3 files changed, 33 insertions, 19 deletions
diff --git a/Library/Homebrew/test/test_bucket.rb b/Library/Homebrew/test/test_bucket.rb
index 300d61b73..c93c5db39 100644
--- a/Library/Homebrew/test/test_bucket.rb
+++ b/Library/Homebrew/test/test_bucket.rb
@@ -2,13 +2,6 @@
# separate TestCase classes.
class BeerTasting < Test::Unit::TestCase
- def test_put_columns_empty
- assert_nothing_raised do
- # Issue #217 put columns with new results fails.
- puts_columns []
- end
- end
-
def test_supported_compressed_types
assert_nothing_raised do
MockFormula.new 'test-0.1.tar.gz'
@@ -143,18 +136,6 @@ class BeerTasting < Test::Unit::TestCase
assert_equal 10.7, f+0.1
end
- def test_arch_for_command
- arches=archs_for_command '/usr/bin/svn'
- if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i >= 6
- assert_equal 3, arches.length
- assert arches.include?(:x86_64)
- else
- assert_equal 2, arches.length
- end
- assert arches.include?(:i386)
- assert arches.include?(:ppc7400)
- end
-
def test_pathname_version
d=HOMEBREW_CELLAR+'foo-0.1.9'
d.mkpath
diff --git a/Library/Homebrew/test/test_utils.rb b/Library/Homebrew/test/test_utils.rb
new file mode 100644
index 000000000..98f31ca41
--- /dev/null
+++ b/Library/Homebrew/test/test_utils.rb
@@ -0,0 +1,30 @@
+require 'testing_env'
+
+require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
+ARGV.extend(HomebrewArgvExtension)
+
+require 'utils'
+
+
+class UtilTests < Test::Unit::TestCase
+
+ def test_put_columns_empty
+ assert_nothing_raised do
+ # Issue #217 put columns with new results fails.
+ puts_columns []
+ end
+ end
+
+ def test_arch_for_command
+ arches=archs_for_command '/usr/bin/svn'
+ if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i >= 6
+ assert_equal 3, arches.length
+ assert arches.include?(:x86_64)
+ else
+ assert_equal 2, arches.length
+ end
+ assert arches.include?(:i386)
+ assert arches.include?(:ppc7400)
+ end
+
+end
diff --git a/Library/Homebrew/test/tests b/Library/Homebrew/test/tests
index a81abd2a4..44fba7a28 100755
--- a/Library/Homebrew/test/tests
+++ b/Library/Homebrew/test/tests
@@ -32,3 +32,6 @@ ruby test_external_deps.rb $*
# Test Pathname.install
ruby test_pathname_install.rb $*
+
+# Test utility functions
+ruby test_utils.rb $*