tests: remove special-casing @path in TestBall
Tests that expect Formula#path to resolve to a real path should use TestBallWithRealPath; TestBall gets its original behavior back, fixing a failing test in test_formula_install. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
bf0955dc8a
commit
a64f417f36
@ -86,7 +86,7 @@ class BeerTasting < Test::Unit::TestCase
|
|||||||
|
|
||||||
nostdout do
|
nostdout do
|
||||||
assert_nothing_raised do
|
assert_nothing_raised do
|
||||||
f=TestBall.new
|
f=TestBallWithRealPath.new
|
||||||
Homebrew.info_formula f
|
Homebrew.info_formula f
|
||||||
Cleaner.new f
|
Cleaner.new f
|
||||||
Homebrew.prune
|
Homebrew.prune
|
||||||
|
|||||||
@ -6,7 +6,6 @@ class TestBall <Formula
|
|||||||
@url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
@url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
||||||
@homepage = 'http://example.com/'
|
@homepage = 'http://example.com/'
|
||||||
super "testball"
|
super "testball"
|
||||||
@path = Pathname.new(__FILE__)
|
|
||||||
end
|
end
|
||||||
def install
|
def install
|
||||||
prefix.install "bin"
|
prefix.install "bin"
|
||||||
@ -14,6 +13,13 @@ class TestBall <Formula
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class TestBallWithRealPath < TestBall
|
||||||
|
def initialize name=nil
|
||||||
|
super "testballwithrealpath"
|
||||||
|
@path = Pathname.new(__FILE__)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class TestBallWithMirror < Formula
|
class TestBallWithMirror < Formula
|
||||||
# `url` is bogus---curl should fail to download it. The mirror is fine
|
# `url` is bogus---curl should fail to download it. The mirror is fine
|
||||||
# though.
|
# though.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user