brew/Library/Homebrew/test/test_bottle.rb
Øyvind Ingebrigtsen Øvergaard cf2bf08ec9 bottle: don't read mtime from nonexistant files
If the source contains a broken symlink, `brew bottle` would fail for no
good reason when trying to determine the most recently modified
file. To avoid this, we ignore any files for which stat(2) fails.

Closes Homebrew/homebrew#47111.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-21 07:54:30 +00:00

9 lines
263 B
Ruby

require "testing_env"
require "cmd/bottle"
class BottleTests < Homebrew::TestCase
def test_most_recent_mtime_with_broken_symlink()
refute_nil Homebrew.most_recent_mtime(Pathname(File.join(TEST_DIRECTORY, 'resources/source-with-broken-symlink')))
end
end