aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2016-07-16 21:06:30 +0100
committerMike McQuaid2016-07-27 15:05:42 -0600
commit541e8f28df7f8d7a21f976e669190a32fe88473e (patch)
tree3d8ca8dd3a680cbc2a7a36690728036769b4a09c /Library/Homebrew
parent892a3239bc4b382ed2c1b714396650f28096da2e (diff)
downloadbrew-541e8f28df7f8d7a21f976e669190a32fe88473e.tar.bz2
bottles: more porting to generic layer.
Diffstat (limited to 'Library/Homebrew')
l---------Library/Homebrew/test/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz1
-rw-r--r--Library/Homebrew/test/test_bottle_collector.rb14
-rw-r--r--Library/Homebrew/test/test_os_mac_bottle_collector.rb26
-rw-r--r--Library/Homebrew/test/test_os_mac_bottle_tag.rb (renamed from Library/Homebrew/test/test_bottle_tag.rb)2
-rw-r--r--Library/Homebrew/utils/bottles.rb2
5 files changed, 29 insertions, 16 deletions
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz b/Library/Homebrew/test/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/test_bottle_collector.rb b/Library/Homebrew/test/test_bottle_collector.rb
index fa356cb93..d75e29ec8 100644
--- a/Library/Homebrew/test/test_bottle_collector.rb
+++ b/Library/Homebrew/test/test_bottle_collector.rb
@@ -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
diff --git a/Library/Homebrew/test/test_os_mac_bottle_collector.rb b/Library/Homebrew/test/test_os_mac_bottle_collector.rb
new file mode 100644
index 000000000..2f88050ae
--- /dev/null
+++ b/Library/Homebrew/test/test_os_mac_bottle_collector.rb
@@ -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
diff --git a/Library/Homebrew/test/test_bottle_tag.rb b/Library/Homebrew/test/test_os_mac_bottle_tag.rb
index 174c7d14e..996bd4d53 100644
--- a/Library/Homebrew/test/test_bottle_tag.rb
+++ b/Library/Homebrew/test/test_os_mac_bottle_tag.rb
@@ -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)
diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb
index 8447f2472..7b40a2e41 100644
--- a/Library/Homebrew/utils/bottles.rb
+++ b/Library/Homebrew/utils/bottles.rb
@@ -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)