aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2012-06-15 20:02:49 -0500
committerJack Nagel2012-06-15 20:06:36 -0500
commitdc7b6207549f1d87a2188177d8a957deab11fce9 (patch)
tree264026d3872266301f032d979c6700960866d99b /Library/Homebrew/test
parent940ebb116586699105476ca5a5a6a4fa66f5655d (diff)
downloadhomebrew-dc7b6207549f1d87a2188177d8a957deab11fce9.tar.bz2
Improve Pathname#text_executable? regexp
file(1) does not allow leading whitespace on shebang lines, and there appears to be no restrictions on what characters follow '#!', either. While at it, fix an erroneous shebang test. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_mach.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/test/test_mach.rb b/Library/Homebrew/test/test_mach.rb
index 9b9c3cd9b..a0efb6928 100644
--- a/Library/Homebrew/test/test_mach.rb
+++ b/Library/Homebrew/test/test_mach.rb
@@ -135,7 +135,7 @@ class TextExecutableTests < Test::Unit::TestCase
def test_malformed_shebang
pn = Pathname.new('baz')
- pn.write '#! '
+ pn.write ' #!'
assert !pn.universal?
assert !pn.i386?
assert !pn.x86_64?
@@ -146,7 +146,7 @@ class TextExecutableTests < Test::Unit::TestCase
assert !pn.text_executable?
assert_equal [], pn.archs
assert pn.arch == :dunno
- assert_match /text executable/, `/usr/bin/file -h '#{pn}'`.chomp
+ assert_no_match /text executable/, `/usr/bin/file -h '#{pn}'`.chomp
end
def teardown