aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJosh Hagins2016-10-09 19:43:55 -0400
committerJosh Hagins2016-10-24 16:21:08 -0400
commitc46155aba48b1b4ee99aa9d9fb1e0067e899e1e1 (patch)
treed433d97bc3a860146851f717abcbad47da59a3ea /Library/Homebrew/test
parente6bce5ec27306e85a8312400f44d8b9685f9e981 (diff)
downloadbrew-c46155aba48b1b4ee99aa9d9fb1e0067e899e1e1.tar.bz2
keg_relocate: cache files rewritten during brew bottle
`brew bottle` replaces instances of the Homebrew prefix, cellar, and repository with placeholders in all text files. Cache these files in INSTALL_RECEIPT.json so that we don't have to check every single text file for placeholders on install.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/fixtures/receipt.json4
-rw-r--r--Library/Homebrew/test/test_tab.rb5
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/test/fixtures/receipt.json b/Library/Homebrew/test/fixtures/receipt.json
index 62672bfa9..404251026 100644
--- a/Library/Homebrew/test/fixtures/receipt.json
+++ b/Library/Homebrew/test/fixtures/receipt.json
@@ -9,6 +9,10 @@
],
"built_as_bottle": false,
"poured_from_bottle": true,
+ "changed_files": [
+ "INSTALL_RECEIPT.json",
+ "bin/foo"
+ ],
"time": 1403827774,
"HEAD": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
"alias_path": "/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/test-formula",
diff --git a/Library/Homebrew/test/test_tab.rb b/Library/Homebrew/test/test_tab.rb
index 93c88d64b..3db7bbea1 100644
--- a/Library/Homebrew/test/test_tab.rb
+++ b/Library/Homebrew/test/test_tab.rb
@@ -11,6 +11,7 @@ class TabTests < Homebrew::TestCase
"unused_options" => @unused.as_flags,
"built_as_bottle" => false,
"poured_from_bottle" => true,
+ "changed_files" => [],
"time" => nil,
"source_modified_time" => 0,
"HEAD" => TEST_SHA1,
@@ -33,6 +34,7 @@ class TabTests < Homebrew::TestCase
tab = Tab.empty
assert_empty tab.unused_options
assert_empty tab.used_options
+ assert_empty tab.changed_files
refute_predicate tab, :built_as_bottle
refute_predicate tab, :poured_from_bottle
assert_predicate tab, :stable?
@@ -105,9 +107,11 @@ class TabTests < Homebrew::TestCase
tab = Tab.from_file(path)
source_path = "/usr/local/Library/Taps/hombrew/homebrew-core/Formula/foo.rb"
runtime_dependencies = [{ "full_name" => "foo", "version" => "1.0" }]
+ changed_files = %w[INSTALL_RECEIPT.json bin/foo]
assert_equal @used.sort, tab.used_options.sort
assert_equal @unused.sort, tab.unused_options.sort
+ assert_equal changed_files, tab.changed_files
refute_predicate tab, :built_as_bottle
assert_predicate tab, :poured_from_bottle
assert_predicate tab, :stable?
@@ -187,6 +191,7 @@ class TabTests < Homebrew::TestCase
assert_equal @tab.unused_options.sort, tab.unused_options.sort
assert_equal @tab.built_as_bottle, tab.built_as_bottle
assert_equal @tab.poured_from_bottle, tab.poured_from_bottle
+ assert_equal @tab.changed_files, tab.changed_files
assert_equal @tab.tap, tab.tap
assert_equal @tab.spec, tab.spec
assert_equal @tab.time, tab.time