mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

While at it, make it use class methods instead; no reason to instantiate an object for this. Eventually there should be some functional tests for the individual strategies as well. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
20 lines
535 B
Ruby
20 lines
535 B
Ruby
require 'testing_env'
|
|
require 'download_strategy'
|
|
require 'bottles' # XXX: hoist these regexps into constants in Pathname?
|
|
|
|
class DownloadStrategyDetectorTests < Test::Unit::TestCase
|
|
def setup
|
|
@d = DownloadStrategyDetector.new
|
|
end
|
|
|
|
def test_detect_git_download_startegy
|
|
@d = DownloadStrategyDetector.detect("git://foo.com/bar.git")
|
|
assert_equal GitDownloadStrategy, @d
|
|
end
|
|
|
|
def test_default_to_curl_strategy
|
|
@d = DownloadStrategyDetector.detect(Object.new)
|
|
assert_equal CurlDownloadStrategy, @d
|
|
end
|
|
end
|