aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_formula.rb
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-09-16 11:04:12 -0700
committerCharlie Sharpsteen2011-09-19 09:25:02 -0700
commitb44c76cad0ecd4e488be85edcb2d4a5a03c6d817 (patch)
treec229e6dc713e29708bc0d44ca5eb3776b3f8e2c9 /Library/Homebrew/test/test_formula.rb
parentefcdbd691e672b8fa0f57540e1f687b07b7d84f8 (diff)
downloadhomebrew-b44c76cad0ecd4e488be85edcb2d4a5a03c6d817.tar.bz2
mirror support: Add test
Diffstat (limited to 'Library/Homebrew/test/test_formula.rb')
-rw-r--r--Library/Homebrew/test/test_formula.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index fd3987168..a819e5751 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -6,6 +6,9 @@ ARGV.extend(HomebrewArgvExtension)
require 'test/testball'
require 'utils'
+class AbstractDownloadStrategy
+ attr_reader :url
+end
class MostlyAbstractFormula <Formula
@url=''
@@ -50,5 +53,13 @@ class FormulaTests < Test::Unit::TestCase
assert_raises(RuntimeError) { f.prefix }
nostdout { assert_raises(RuntimeError) { f.brew } }
end
-
+
+ def test_mirror_support
+ HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
+ f = TestBallWithMirror.new
+ tarball, 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
end