test_mach: move helper method out of global namespace
This commit is contained in:
parent
41af459205
commit
a886a1b3e3
@ -1,10 +1,14 @@
|
|||||||
require 'testing_env'
|
require 'testing_env'
|
||||||
|
|
||||||
def file pn
|
module FileHelper
|
||||||
`/usr/bin/file -h '#{pn}'`.chomp
|
def file pn
|
||||||
|
`/usr/bin/file -h '#{pn}'`.chomp
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class MachOPathnameTests < Test::Unit::TestCase
|
class MachOPathnameTests < Test::Unit::TestCase
|
||||||
|
include FileHelper
|
||||||
|
|
||||||
def test_fat_dylib
|
def test_fat_dylib
|
||||||
pn = Pathname.new("#{TEST_FOLDER}/mach/fat.dylib")
|
pn = Pathname.new("#{TEST_FOLDER}/mach/fat.dylib")
|
||||||
assert pn.universal?
|
assert pn.universal?
|
||||||
@ -136,6 +140,8 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
class TextExecutableTests < Test::Unit::TestCase
|
class TextExecutableTests < Test::Unit::TestCase
|
||||||
|
include FileHelper
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
(HOMEBREW_PREFIX/'foo_script').unlink
|
(HOMEBREW_PREFIX/'foo_script').unlink
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user