aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-04-08 19:15:22 -0500
committerJack Nagel2013-04-08 19:15:22 -0500
commit63aace0e4e5f6ca0b363e4c5bfd1ae7512a8d091 (patch)
tree09222a0839ee127cb039e800cd3b6d455d176997 /Library
parent646102c31118144545127b7ed70512de753d1d40 (diff)
downloadbrew-63aace0e4e5f6ca0b363e4c5bfd1ae7512a8d091.tar.bz2
Clean up mirror support test
Diffstat (limited to 'Library')
-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'