test_download_strategies: add mtime test
This commit is contained in:
parent
7958343f16
commit
8deec537d1
@ -1 +0,0 @@
|
||||
does-not-exist
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user