bottles: more porting to generic layer.

This commit is contained in:
Mike McQuaid 2016-07-16 21:06:30 +01:00
parent 892a3239bc
commit 541e8f28df
5 changed files with 29 additions and 16 deletions

View File

@ -0,0 +1 @@
testball_bottle-0.1.yosemite.bottle.tar.gz

View File

@ -30,23 +30,9 @@ class BottleCollectorTests < Homebrew::TestCase
assert_nil checksum_for(:foo)
end
def test_collector_finds_or_later_tags
@collector[:lion_or_later] = "foo"
assert_equal ["foo", :lion_or_later], checksum_for(:mountain_lion)
assert_nil checksum_for(:snow_leopard)
end
def test_collector_prefers_exact_matches
@collector[:lion_or_later] = "foo"
@collector[:mountain_lion] = "bar"
assert_equal ["bar", :mountain_lion], checksum_for(:mountain_lion)
end
def test_collector_finds_altivec_tags
@collector[:tiger_altivec] = "foo"
assert_equal ["foo", :tiger_altivec], checksum_for(:tiger_g4)
assert_equal ["foo", :tiger_altivec], checksum_for(:tiger_g4e)
assert_equal ["foo", :tiger_altivec], checksum_for(:tiger_g5)
assert_nil checksum_for(:tiger_g3)
end
end

View File

@ -0,0 +1,26 @@
require "testing_env"
require "utils/bottles"
class OSMacBottleCollectorTests < Homebrew::TestCase
def setup
@collector = Utils::Bottles::Collector.new
end
def checksum_for(tag)
@collector.fetch_checksum_for(tag)
end
def test_collector_finds_or_later_tags
@collector[:lion_or_later] = "foo"
assert_equal ["foo", :lion_or_later], checksum_for(:mountain_lion)
assert_nil checksum_for(:snow_leopard)
end
def test_collector_finds_altivec_tags
@collector[:tiger_altivec] = "foo"
assert_equal ["foo", :tiger_altivec], checksum_for(:tiger_g4)
assert_equal ["foo", :tiger_altivec], checksum_for(:tiger_g4e)
assert_equal ["foo", :tiger_altivec], checksum_for(:tiger_g5)
assert_nil checksum_for(:tiger_g3)
end
end

View File

@ -1,7 +1,7 @@
require "testing_env"
require "utils/bottles"
class BottleTagTests < Homebrew::TestCase
class OSMacBottleTagTests < Homebrew::TestCase
def test_tag_tiger_ppc
MacOS.stubs(:version).returns(MacOS::Version.new("10.4"))
Hardware::CPU.stubs(:type).returns(:ppc)

View File

@ -5,7 +5,7 @@ module Utils
class Bottles
class << self
def tag
@bottle_tag ||= "#{ENV["HOMEBREW_SYSTEM"]}-#{ENV["HOMEBREW_PROCESSOR"]}".downcase.to_sym
@bottle_tag ||= "#{ENV["HOMEBREW_SYSTEM"]}_#{ENV["HOMEBREW_PROCESSOR"]}".downcase.to_sym
end
def built_as?(f)