Add test for InstallRenamed module
This commit is contained in:
parent
58b99f2cee
commit
3b7c5af431
@ -1,6 +1,7 @@
|
|||||||
require 'testing_env'
|
require 'testing_env'
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'extend/pathname'
|
require 'extend/pathname'
|
||||||
|
require 'install_renamed'
|
||||||
|
|
||||||
class PathnameExtensionTests < Homebrew::TestCase
|
class PathnameExtensionTests < Homebrew::TestCase
|
||||||
include FileUtils
|
include FileUtils
|
||||||
@ -197,4 +198,16 @@ class PathnameExtensionTests < Homebrew::TestCase
|
|||||||
@dir.install(@file)
|
@dir.install(@file)
|
||||||
assert_predicate @dir, :directory?
|
assert_predicate @dir, :directory?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_install_renamed
|
||||||
|
@dir.extend(InstallRenamed)
|
||||||
|
|
||||||
|
@file.write "a"
|
||||||
|
@dir.install @file
|
||||||
|
@file.write "b"
|
||||||
|
@dir.install @file
|
||||||
|
|
||||||
|
assert_equal "a", File.read(@dir+@file.basename)
|
||||||
|
assert_equal "b", File.read(@dir+"#{@file.basename}.default")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user