do a deep copy of the hash
This commit is contained in:
parent
6a540e6841
commit
eb634265e6
@ -387,7 +387,7 @@ module FakeFS
|
||||
end
|
||||
|
||||
def clone(parent)
|
||||
clone = super()
|
||||
clone = Marshal.load(Marshal.dump(self))
|
||||
clone.each do |key, value|
|
||||
value.parent = parent
|
||||
end
|
||||
|
@ -197,8 +197,10 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
FileUtils.mkdir_p '/path/bar'
|
||||
File.open('/path/bar/baz', 'w'){|f| f.write 'foo' }
|
||||
|
||||
FileUtils.cp_r '/path/bar', '/path/bar2'
|
||||
|
||||
assert_equal ['/path'], Dir['/path']
|
||||
assert_equal ['/path/bar', '/path/foo', '/path/foobar'], Dir['/path/*']
|
||||
assert_equal %w( /path/bar /path/bar2 /path/foo /path/foobar ), Dir['/path/*']
|
||||
|
||||
assert_equal ['/path/bar/baz'], Dir['/path/bar/*']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user