aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-06-10 20:40:51 -0500
committerJack Nagel2014-06-10 20:40:51 -0500
commit7f69dadcd0af5884530dbd01f541c472248ae8c9 (patch)
treefb1b15e95cadd2cc5ce86bd4ab027905ced8bb1e /Library/Homebrew
parent678c71c67b862cc41eb58b0b98d44f0efa80e161 (diff)
downloadhomebrew-7f69dadcd0af5884530dbd01f541c472248ae8c9.tar.bz2
Pull common code into setup method
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/test/test_mach.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/test/test_mach.rb b/Library/Homebrew/test/test_mach.rb
index f472cced9..5be10bb7c 100644
--- a/Library/Homebrew/test/test_mach.rb
+++ b/Library/Homebrew/test/test_mach.rb
@@ -171,12 +171,17 @@ end
class TextExecutableTests < Test::Unit::TestCase
include FileHelper
+ attr_reader :pn
+
+ def setup
+ @pn = HOMEBREW_PREFIX.join("an_executable")
+ end
+
def teardown
- (HOMEBREW_PREFIX/'foo_script').unlink
+ HOMEBREW_PREFIX.join("an_executable").unlink
end
def test_simple_shebang
- pn = HOMEBREW_PREFIX/'foo_script'
pn.write '#!/bin/sh'
assert !pn.universal?
assert !pn.i386?
@@ -192,7 +197,6 @@ class TextExecutableTests < Test::Unit::TestCase
end
def test_shebang_with_options
- pn = HOMEBREW_PREFIX/'foo_script'
pn.write '#! /usr/bin/perl -w'
assert !pn.universal?
assert !pn.i386?
@@ -208,7 +212,6 @@ class TextExecutableTests < Test::Unit::TestCase
end
def test_malformed_shebang
- pn = HOMEBREW_PREFIX/'foo_script'
pn.write ' #!'
assert !pn.universal?
assert !pn.i386?