adding 'parent' attr_accessor to FakeFS::FakeSymlink (#69)
This commit is contained in:
parent
8b0d10b94b
commit
1597e76c7f
@ -1,6 +1,6 @@
|
||||
module FakeFS
|
||||
class FakeSymlink
|
||||
attr_accessor :name, :target
|
||||
attr_accessor :name, :target, :parent
|
||||
alias_method :to_s, :name
|
||||
|
||||
def initialize(target)
|
||||
|
@ -141,6 +141,12 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
assert_equal target, File.readlink(link)
|
||||
end
|
||||
|
||||
def test_symlinks_in_different_directories
|
||||
FileUtils.mkdir_p(target = "/path/to/foo/target")
|
||||
FileUtils.ln_s(target, link = "/path/to/bar/symlink")
|
||||
assert_equal target, File.readlink(link)
|
||||
end
|
||||
|
||||
def test_knows_symlinks_are_symlinks
|
||||
FileUtils.mkdir_p(target = "/path/to/target")
|
||||
FileUtils.ln_s(target, link = "/path/to/symlink")
|
||||
|
Loading…
Reference in New Issue
Block a user