Comments (4)
It looks like you generated this patch with git-format-patch, but haven't set your email address (with git config), which makes it unappliable with git-am.
Could you set your email address & regenerate the patch with git-format-patch? Instructions for doing so are here:
http://help.github.com/git-email-settings/
from fakefs.
Oh, sorry. Is this OK?
From f12de1b467c46e04677b44d248d1557e34f865ba Mon Sep 17 00:00:00 2001 From: Keita Urashima <[email protected]> Date: Wed, 25 Nov 2009 01:21:25 +0900 Subject: [PATCH] FileUtils.rm should be able to delete two or more files --- lib/fakefs/fileutils.rb | 6 ++++-- test/fakefs_test.rb | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/fakefs/fileutils.rb b/lib/fakefs/fileutils.rb index bb61c07..34fec0e 100644 --- a/lib/fakefs/fileutils.rb +++ b/lib/fakefs/fileutils.rb @@ -19,8 +19,10 @@ module FakeFS end end - def rm(path) - FileSystem.delete(path) + def rm(list, options = {}) + Array(list).each do |path| + FileSystem.delete(path) + end end alias_method :rm_rf, :rm diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index ab4e0e2..8e31376 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -37,6 +37,13 @@ class FakeFSTest < Test::Unit::TestCase assert File.exists?("/path/to/dir") == false end + def test_can_delete_multiple_files + FileUtils.touch(["foo", "bar"]) + FileUtils.rm(["foo", "bar"]) + assert File.exists?("foo") == false + assert File.exists?("bar") == false + end + def test_knows_directories_exist FileUtils.mkdir_p(path = "/path/to/dir") assert File.exists?(path) -- 1.6.5.3
from fakefs.
or, please pull from here.
http://github.com/ursm/fakefs
from fakefs.
Cool - thanks. I'll look into applying it tonight.
from fakefs.
Related Issues (20)
- please add ruby2.7 support HOT 3
- tests for the verbose option in cp and mv fail randomly under ruby 2.7 HOT 1
- Regression: FakeFS::File became non-IO HOT 2
- inconsitencies with some methods when passed an empty path HOT 1
- Dir.open() { |foo| ... } differs from standard Dir.open HOT 2
- Dir.glob fails if chdir to a directory that contains plus signs '+' HOT 4
- `File.readlines(path, chomp: true)` isn't supported (standard) HOT 1
- How do I simulate an ELOOP? HOT 4
- IO not mocked (specifically, IO.read not mocked) HOT 1
- How to use with byebug? HOT 2
- Mocking isolated directories HOT 1
- Pathname#glob HOT 3
- Using requests with fakefs HOT 2
- git head testsuite fails with ruby3.2dev for some unavailable method HOT 3
- File system and objects are not auto loaded on Ruby 3.0.4 HOT 5
- Can't use IRB when FakeFS is activated HOT 1
- Pathname's #realdirpath and #realpath do not work (as intended) HOT 1
- Ruby3 Kernel.open() handling of kwargs fails after fakefs deactivation HOT 3
- Calling FileUtils.touch on a symlink with a missing target throws an exception instead of creating the file HOT 1
- fakefs 2.5.0 testsuite fails with ruby 3.3.2 / irb 1.3.1 and above HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fakefs.