FileUtils.mv should raise error on missing file
This commit is contained in:
parent
45b0e2828f
commit
2b3132096c
@ -32,6 +32,8 @@ module FakeFS
|
||||
if target = FileSystem.find(src)
|
||||
FileSystem.add(dest, target.entry)
|
||||
FileSystem.delete(src)
|
||||
else
|
||||
raise Errno::ENOENT, src
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -259,4 +259,10 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
r = File.open('foo','w'){|f| f.write 'bar'; f.flush }
|
||||
assert_equal 'foo', r.path
|
||||
end
|
||||
|
||||
def test_mv_should_raise_error_on_missing_file
|
||||
assert_raise(Errno::ENOENT) do
|
||||
FileUtils.mv 'blafgag', 'foo'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user