diff --git a/Library/Homebrew/test/resources/source-with-broken-symlink/broken-link b/Library/Homebrew/test/resources/source-with-broken-symlink/broken-link deleted file mode 120000 index cfa0a46515..0000000000 --- a/Library/Homebrew/test/resources/source-with-broken-symlink/broken-link +++ /dev/null @@ -1 +0,0 @@ -does-not-exist \ No newline at end of file diff --git a/Library/Homebrew/test/test_bottle.rb b/Library/Homebrew/test/test_bottle.rb deleted file mode 100644 index f4398cc1d7..0000000000 --- a/Library/Homebrew/test/test_bottle.rb +++ /dev/null @@ -1,8 +0,0 @@ -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 diff --git a/Library/Homebrew/test/test_download_strategies.rb b/Library/Homebrew/test/test_download_strategies.rb index 45d0d31884..24f38ad2de 100644 --- a/Library/Homebrew/test/test_download_strategies.rb +++ b/Library/Homebrew/test/test_download_strategies.rb @@ -11,6 +11,8 @@ class ResourceDouble end class AbstractDownloadStrategyTests < Homebrew::TestCase + include FileUtils + def setup @name = "foo" @resource = ResourceDouble.new @@ -34,6 +36,15 @@ class AbstractDownloadStrategyTests < Homebrew::TestCase assert_equal %w[foo bar baz], @args refute_same @args, result end + + def test_source_modified_time + mktemp "mtime" do + touch "foo", :mtime => Time.now - 10 + touch "bar", :mtime => Time.now - 100 + ln_s "not-exist", "baz" + assert_equal File.mtime("foo"), @strategy.source_modified_time + end + end end class VCSDownloadStrategyTests < Homebrew::TestCase