2010-03-08 22:10:12 -08:00
|
|
|
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'
|
2012-03-08 00:52:13 -08:00
|
|
|
if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i >= 7
|
|
|
|
assert_equal 2, arches.length
|
|
|
|
assert arches.include?(:x86_64)
|
|
|
|
elsif `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i = 6
|
2010-03-08 22:10:12 -08:00
|
|
|
assert_equal 3, arches.length
|
|
|
|
assert arches.include?(:x86_64)
|
2012-03-08 00:52:13 -08:00
|
|
|
assert arches.include?(:ppc7400)
|
2010-03-08 22:10:12 -08:00
|
|
|
else
|
|
|
|
assert_equal 2, arches.length
|
2012-03-08 00:52:13 -08:00
|
|
|
assert arches.include?(:ppc7400)
|
2010-03-08 22:10:12 -08:00
|
|
|
end
|
|
|
|
assert arches.include?(:i386)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|