Raising Errno::ENOENT exception with a particular path instead of src, which may be an array.

Closes #59
This commit is contained in:
Mariusz Pietrzyk 2010-12-28 10:25:19 +01:00 committed by Scott Taylor
parent 3916ffc91d
commit 8bf4b5aeb0
2 changed files with 6 additions and 3 deletions

View File

@ -102,7 +102,7 @@ module FakeFS
FileSystem.add(dest_path, target.entry.clone)
FileSystem.delete(path)
else
raise Errno::ENOENT, src
raise Errno::ENOENT, path
end
end
end

View File

@ -568,7 +568,6 @@ class FakeFSTest < Test::Unit::TestCase
assert_equal ['/path', '/path/bar', '/path/bar/baz', '/path/bar2', '/path/bar2/baz', '/path/foo', '/path/foobar'], Dir['/**/*']
assert_equal ['/path/bar', '/path/bar/baz', '/path/bar2', '/path/bar2/baz', '/path/foo', '/path/foobar'], Dir['/path/**/*']
assert_equal ['/path/bar/baz'], Dir['/path/bar/**/*']
FileUtils.cp_r '/path', '/otherpath'
@ -803,6 +802,10 @@ class FakeFSTest < Test::Unit::TestCase
assert_raise(Errno::ENOENT) do
FileUtils.mv 'blafgag', 'foo'
end
exception = assert_raise(Errno::ENOENT) do
FileUtils.mv ['foo', 'bar'], 'destdir'
end
assert_equal "No such file or directory - foo", exception.message
end
def test_mv_actually_works
@ -1610,7 +1613,7 @@ class FakeFSTest < Test::Unit::TestCase
def test_deactivating_returns_true
assert_equal true, FakeFS.deactivate!
end
def test_split
assert File.respond_to? :split
filename = "/this/is/what/we/expect.txt"