aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/test/test_formula.rb21
-rw-r--r--Library/Homebrew/test/testball.rb9
2 files changed, 10 insertions, 20 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index 3bcf91f10..918ff714f 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -1,10 +1,6 @@
require 'testing_env'
require 'test/testball'
-class AbstractDownloadStrategy
- attr_reader :url
-end
-
class MostlyAbstractFormula < Formula
url ''
end
@@ -40,13 +36,16 @@ class FormulaTests < Test::Unit::TestCase
end
def test_mirror_support
- HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
- shutup do
- f = TestBallWithMirror.new
- _, downloader = f.fetch
- assert_equal f.url, "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz"
- assert_equal downloader.url, "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
- end
+ f = Class.new(Formula) do
+ url "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz"
+ mirror "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
+ end.new("test_mirror_support")
+
+ shutup { f.fetch }
+
+ assert_equal "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz", f.url
+ assert_equal "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz",
+ f.downloader.instance_variable_get(:@url)
end
def test_formula_specs
diff --git a/Library/Homebrew/test/testball.rb b/Library/Homebrew/test/testball.rb
index 13f54f3df..b18fe3e68 100644
--- a/Library/Homebrew/test/testball.rb
+++ b/Library/Homebrew/test/testball.rb
@@ -16,15 +16,6 @@ class TestBall < Formula
end
end
-class TestBallWithMirror < Formula
- url "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz"
- mirror "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
-
- def initialize(*)
- super "testballwithmirror"
- end
-end
-
class ConfigureFails < Formula
url "file:///#{TEST_FOLDER}/tarballs/configure_fails.tar.gz"
version '1.0.0'