diff options
| author | Charlie Sharpsteen | 2011-09-16 11:04:12 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-09-19 09:25:02 -0700 |
| commit | 3ada407922eb5babbf58629aedbc70a3f2ca5450 (patch) | |
| tree | 465a819c675983ff8e3122c302768ea7d8c8d8ed /Library/Homebrew/test/test_formula.rb | |
| parent | 9d19506ee9d79d35eec5063ee1e971583fe79460 (diff) | |
| download | brew-3ada407922eb5babbf58629aedbc70a3f2ca5450.tar.bz2 | |
mirror support: Add test
Diffstat (limited to 'Library/Homebrew/test/test_formula.rb')
| -rw-r--r-- | Library/Homebrew/test/test_formula.rb | 13 |
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 |
