fakefs 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +11 -0
- data/.travis.yml +5 -0
- data/CONTRIBUTORS +44 -6
- data/Gemfile +2 -6
- data/README.markdown +4 -2
- data/Rakefile +3 -32
- data/fakefs.gemspec +21 -79
- data/lib/fakefs/dir.rb +11 -5
- data/lib/fakefs/fake/symlink.rb +1 -1
- data/lib/fakefs/file.rb +32 -14
- data/lib/fakefs/file_system.rb +15 -9
- data/lib/fakefs/file_test.rb +10 -4
- data/lib/fakefs/fileutils.rb +37 -7
- data/lib/fakefs/version.rb +1 -1
- data/spec/fakefs/fakefs_bug_ruby_2.1.0-preview2_spec.rb +17 -0
- data/test/fakefs_test.rb +221 -17
- data/test/file/stat_test.rb +6 -1
- data/test/test_helper.rb +16 -0
- metadata +47 -25
- data/Gemfile.lock +0 -31
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTIzY2Q2ZDAyZTJlNGQ5ODc4NDM1ODY1OGM0YThhNDRjYWNjOWQ0OQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzU3YWZlYzg4MmE5ZDg2ZGI0NzE4ZjNhZDZjYTgzMDZhZjQ3Y2Q4YQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NzcxODdlNzE1MzBiOTM5MDM0MWZjNDA1YTc1MDNjN2E2ZmU3NmM0MmQ0ZGNh
|
10
|
+
OTY5N2NhYjFhZGFlZDk4YzY2OTU1OTRhZjA2OTc1NTA0NzMwNDMzNTUwNDcx
|
11
|
+
NzkxOTczYTcxMDcwNmViYTQ0Y2RiMDQzNTBjMzUxMjU5ODFmOGI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OWFjNTJlZGI2Y2FiN2ViZGE4YjM0MDU0MTRlN2FhNDRkNDgwMGEwOGQ0MzBm
|
14
|
+
YjhlMjdkYTAxN2Y3YTc2NmVlMWYwNjNhYTExMmUwYTYxZmRiNWU3ZmUyYWM5
|
15
|
+
NjE2YjQxNGM1YmFiNWVjZDAyZjM1YjA4NDE4MTNmMGI4MWFjY2U=
|
data/.gitignore
ADDED
data/.travis.yml
CHANGED
data/CONTRIBUTORS
CHANGED
@@ -1,35 +1,73 @@
|
|
1
1
|
Scott Taylor <scott@railsnewbie.com>
|
2
2
|
Pat Nakajima <patnakajima@gmail.com>
|
3
3
|
Chris Wanstrath <chris@ozmm.org>
|
4
|
+
Lukas Oberhuber <lukaso@gmail.com>
|
4
5
|
Myles Eftos <myles@madpilot.com.au>
|
5
6
|
Jeff Hodges <jeff@somethingsimilar.com>
|
7
|
+
Morten Møller Riis <mortenmoellerriis@gmail.com>
|
6
8
|
Matt Freels <matt@freels.name>
|
7
9
|
Eero Saynatkari <projects@kittensoft.org>
|
10
|
+
Andres Riofrio <riofrios@gmail.com>
|
8
11
|
Víctor Martínez <knoopx@gmail.com>
|
12
|
+
Brian Donovan <donovan@squareup.com>
|
13
|
+
Mariusz Pietrzyk <wijet@wijet.pl>
|
14
|
+
John Firebaugh <john.firebaugh@gmail.com>
|
15
|
+
Sebastian Boehm <sebastian@sometimesfood.org>
|
16
|
+
AlphaHydrae <hydrae.alpha@gmail.com>
|
9
17
|
Nick Quaranto <nick@quaran.to>
|
10
18
|
Aaron Suggs <aaron@ktheory.com>
|
11
19
|
Victor Costan <costan@gmail.com>
|
20
|
+
Mateusz Juraszek <meceo00@gmail.com>
|
12
21
|
Eric MSP Veith <eveith@wwweb-library.net>
|
22
|
+
Daniel Dyba <daniel.dyba@gmail.com>
|
23
|
+
Maarten Hoogendoorn <maarten@moretea.nl>
|
13
24
|
Jon Yurek <jyurek@thoughtbot.com>
|
14
25
|
Jared Luxenberg <jared@jaredlux.com>
|
15
|
-
|
26
|
+
DSIW <dsiw@dsiw-it.de>
|
16
27
|
Greg Campbell <gtcampbell@gmail.com>
|
28
|
+
Lars Gierth <lars.gierth@gmail.com>
|
29
|
+
doc75 <github@virlet.org>
|
30
|
+
marano <thiagomarano@gmail.com>
|
17
31
|
Ben Mabey <ben@benmabey.com>
|
32
|
+
Jorge Orlando Munoz <jmunoz@altavistaed.com>
|
18
33
|
Mark <mark@amerine.net>
|
19
34
|
Sam Goldstein <sam@aboutus.org>
|
20
|
-
|
35
|
+
Scott Petersen <petersen@centtech.com>
|
36
|
+
Matt Todd <chiology@gmail.com>
|
37
|
+
Emil Soman <emil.soman@gmail.com>
|
21
38
|
Noah Paessel <knowuh@gmail.com>
|
39
|
+
Ryan McGeary <ryan@mcgeary.org>
|
22
40
|
dmathieu <42@dmathieu.com>
|
23
|
-
|
24
|
-
|
41
|
+
Oleg Sukhodolsky <os97673@gmail.com>
|
42
|
+
Adam Alboyadjian <adam@vistahigherlearning.com>
|
25
43
|
jameswilding <james@jameswilding.net>
|
44
|
+
Ed Ruder <ed@squareup.com>
|
26
45
|
Tymon Tobolski <i@teamon.eu>
|
46
|
+
Benjamin Oakes <hello@benjaminoakes.com>
|
27
47
|
Scott Barron <scott@elitists.net>
|
28
48
|
Andrius Chamentauskas <andrius.chamentauskas@gmail.com>
|
49
|
+
W. Andrew Loe III <andrew@andrewloe.com>
|
50
|
+
Toby Ovod-Everett <toby@ovod-everett.org>
|
51
|
+
Xavier Shay <xavier@squareup.com>
|
52
|
+
Travis Herrick <travis@carbonfive.com>
|
53
|
+
rambutan <usul@usul-HP-EliteBook-8460p.(none)>
|
29
54
|
Keita Urashima <ursm@ursm.jp>
|
30
|
-
|
55
|
+
Matthew Morgan <lytithwyn@gmail.com>
|
56
|
+
andrea longhi <andrea@spaghetticode.it>
|
31
57
|
msassak <msassak@gmail.com>
|
32
|
-
|
58
|
+
David Reese <david@whatcould.com>
|
33
59
|
timo3377 <tim.linquist@gmail.com>
|
60
|
+
Andrius Chamentauskas <sinsiliux@gmail.com>
|
61
|
+
Michael Scherer <misc@zarb.org>
|
62
|
+
Matt Rogers <mattrogers@sbcglobal.net>
|
34
63
|
Mislav Marohnić <mislav.marohnic@gmail.com>
|
64
|
+
Andrew Ryan <nerdrew@gmail.com>
|
35
65
|
Rob Sanheim <rsanheim@gmail.com>
|
66
|
+
Chris Knadler <takeshi91k@gmail.com>
|
67
|
+
Chris Wanstrath <chris@github.com>
|
68
|
+
Toon Willems <willemstoon@gmail.com>
|
69
|
+
Ryan Scott Lewis <ryanscottlewis@lewis-software.com>
|
70
|
+
Yuta Shimizu <pachirel@gmail.com>
|
71
|
+
Jordi Massaguer Pla <jmassaguerpla@suse.de>
|
72
|
+
Benjamin Fleischer <github@benjaminfleischer.com>
|
73
|
+
Brian Donovan <me@brian-donovan.com>
|
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -61,7 +61,9 @@ Rails
|
|
61
61
|
|
62
62
|
If you are using fakefs in a rails project with bundler, you'll probably want to specify the following in your Gemfile:
|
63
63
|
|
64
|
-
|
64
|
+
``` ruby
|
65
|
+
gem "fakefs", :require => "fakefs/safe"
|
66
|
+
```
|
65
67
|
|
66
68
|
|
67
69
|
RSpec
|
@@ -145,7 +147,7 @@ Meta
|
|
145
147
|
|
146
148
|
* Code: `git clone git://github.com/defunkt/fakefs.git`
|
147
149
|
* Home: <http://github.com/defunkt/fakefs>
|
148
|
-
* Docs: <http://
|
150
|
+
* Docs: <http://rdoc.info/github/defunkt/fakefs>
|
149
151
|
* Bugs: <http://github.com/defunkt/fakefs/issues>
|
150
152
|
* Test: <http://travisci.org/#!/defunkt/fakefs>
|
151
153
|
* Gems: <http://rubygems.org/gems/fakefs>
|
data/Rakefile
CHANGED
@@ -21,39 +21,10 @@ end
|
|
21
21
|
|
22
22
|
task :default => [:test, :spec]
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
|
28
|
-
require 'fakefs/version'
|
29
|
-
|
30
|
-
Jeweler::Tasks.new do |gemspec|
|
31
|
-
gemspec.name = "fakefs"
|
32
|
-
gemspec.summary = "A fake filesystem. Use it in your tests."
|
33
|
-
gemspec.email = "chris@ozmm.org"
|
34
|
-
gemspec.homepage = "http://github.com/defunkt/fakefs"
|
35
|
-
gemspec.description = "A fake filesystem. Use it in your tests."
|
36
|
-
gemspec.authors = ["Chris Wanstrath", "Scott Taylor", "Jeff Hodges", "Pat Nakajima"]
|
37
|
-
gemspec.has_rdoc = false
|
38
|
-
gemspec.version = FakeFS::Version.to_s
|
39
|
-
end
|
40
|
-
rescue LoadError
|
41
|
-
puts "Jeweler not available."
|
42
|
-
puts "Install it with: gem install jeweler"
|
43
|
-
end
|
44
|
-
|
45
|
-
desc "Build a gem"
|
46
|
-
task :gem => [ :gemspec, :build ]
|
47
|
-
|
48
|
-
desc "Push a new version to Gemcutter"
|
49
|
-
task :publish => [ :gemspec, :build ] do
|
24
|
+
desc "Push a new version to rubygems.org"
|
25
|
+
task :publish do
|
50
26
|
abort("Tests failed!") unless system("rake test")
|
51
|
-
|
52
|
-
system "git push origin v#{FakeFS::Version}"
|
53
|
-
system "git push origin master"
|
54
|
-
system "gem push pkg/fakefs-#{FakeFS::Version}.gem"
|
55
|
-
system "git clean -fd"
|
56
|
-
exec "rake pages"
|
27
|
+
Rake::Task[:release].invoke
|
57
28
|
end
|
58
29
|
|
59
30
|
desc "Update contributors"
|
data/fakefs.gemspec
CHANGED
@@ -1,83 +1,25 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'fakefs/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "fakefs"
|
8
|
+
spec.version = FakeFS::Version.to_s
|
9
|
+
spec.authors = ["Chris Wanstrath", "Scott Taylor", "Jeff Hodges", "Pat Nakajima", "Brian Donovan"]
|
10
|
+
spec.email = ["chris@ozmm.org"]
|
11
|
+
spec.description = %q{A fake filesystem. Use it in your tests.}
|
12
|
+
spec.summary = %q{A fake filesystem. Use it in your tests.}
|
13
|
+
spec.homepage = "http://github.com/defunkt/fakefs"
|
14
|
+
spec.license = "MIT"
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
s.email = "chris@ozmm.org"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.markdown"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".autotest",
|
21
|
-
".rspec",
|
22
|
-
".travis.yml",
|
23
|
-
"CONTRIBUTORS",
|
24
|
-
"Gemfile",
|
25
|
-
"Gemfile.lock",
|
26
|
-
"LICENSE",
|
27
|
-
"README.markdown",
|
28
|
-
"Rakefile",
|
29
|
-
"fakefs.gemspec",
|
30
|
-
"lib/fakefs.rb",
|
31
|
-
"lib/fakefs/base.rb",
|
32
|
-
"lib/fakefs/dir.rb",
|
33
|
-
"lib/fakefs/fake/dir.rb",
|
34
|
-
"lib/fakefs/fake/file.rb",
|
35
|
-
"lib/fakefs/fake/symlink.rb",
|
36
|
-
"lib/fakefs/file.rb",
|
37
|
-
"lib/fakefs/file_system.rb",
|
38
|
-
"lib/fakefs/file_test.rb",
|
39
|
-
"lib/fakefs/fileutils.rb",
|
40
|
-
"lib/fakefs/pathname.rb",
|
41
|
-
"lib/fakefs/safe.rb",
|
42
|
-
"lib/fakefs/spec_helpers.rb",
|
43
|
-
"lib/fakefs/version.rb",
|
44
|
-
"spec/fakefs/spec_helpers_spec.rb",
|
45
|
-
"spec/spec.opts",
|
46
|
-
"spec/spec_helper.rb",
|
47
|
-
"test/fake/file/join_test.rb",
|
48
|
-
"test/fake/file/lstat_test.rb",
|
49
|
-
"test/fake/file/stat_test.rb",
|
50
|
-
"test/fake/file/sysseek_test.rb",
|
51
|
-
"test/fake/file/syswrite_test.rb",
|
52
|
-
"test/fake/file_test.rb",
|
53
|
-
"test/fake/symlink_test.rb",
|
54
|
-
"test/fakefs_test.rb",
|
55
|
-
"test/file/stat_test.rb",
|
56
|
-
"test/safe_test.rb",
|
57
|
-
"test/test_helper.rb",
|
58
|
-
"test/verify.rb"
|
59
|
-
]
|
60
|
-
s.homepage = "http://github.com/defunkt/fakefs"
|
61
|
-
s.require_paths = ["lib"]
|
62
|
-
s.rubygems_version = "1.8.24"
|
63
|
-
s.summary = "A fake filesystem. Use it in your tests."
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
64
20
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
70
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
71
|
-
s.add_development_dependency(%q<rdiscount>, [">= 0"])
|
72
|
-
else
|
73
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
74
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
75
|
-
s.add_dependency(%q<rdiscount>, [">= 0"])
|
76
|
-
end
|
77
|
-
else
|
78
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
79
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
80
|
-
s.add_dependency(%q<rdiscount>, [">= 0"])
|
81
|
-
end
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "rdiscount"
|
82
25
|
end
|
83
|
-
|
data/lib/fakefs/dir.rb
CHANGED
@@ -3,13 +3,13 @@ module FakeFS
|
|
3
3
|
include Enumerable
|
4
4
|
|
5
5
|
def self._check_for_valid_file(path)
|
6
|
-
raise Errno::ENOENT,
|
6
|
+
raise Errno::ENOENT, path unless FileSystem.find(path)
|
7
7
|
end
|
8
8
|
|
9
9
|
def initialize(string)
|
10
10
|
self.class._check_for_valid_file(string)
|
11
11
|
|
12
|
-
@path = string
|
12
|
+
@path = FileSystem.normalize_path(string)
|
13
13
|
@open = true
|
14
14
|
@pointer = 0
|
15
15
|
@contents = [ '.', '..', ] + FileSystem.find(@path).entries
|
@@ -44,7 +44,13 @@ module FakeFS
|
|
44
44
|
raise IOError, "closed directory" if @pointer == nil
|
45
45
|
n = @contents[@pointer]
|
46
46
|
@pointer += 1
|
47
|
-
|
47
|
+
if n
|
48
|
+
if n.to_s[0, path.size+1] == path+'/'
|
49
|
+
n.to_s[path.size+1..-1]
|
50
|
+
else
|
51
|
+
n.to_s
|
52
|
+
end
|
53
|
+
end
|
48
54
|
end
|
49
55
|
|
50
56
|
def rewind
|
@@ -75,12 +81,12 @@ module FakeFS
|
|
75
81
|
|
76
82
|
def self.delete(string)
|
77
83
|
_check_for_valid_file(string)
|
78
|
-
raise Errno::ENOTEMPTY,
|
84
|
+
raise Errno::ENOTEMPTY, string unless FileSystem.find(string).empty?
|
79
85
|
|
80
86
|
FileSystem.delete(string)
|
81
87
|
end
|
82
88
|
|
83
|
-
def self.entries(dirname)
|
89
|
+
def self.entries(dirname, opts = {})
|
84
90
|
_check_for_valid_file(dirname)
|
85
91
|
|
86
92
|
Dir.new(dirname).map { |file| File.basename(file) }
|
data/lib/fakefs/fake/symlink.rb
CHANGED
data/lib/fakefs/file.rb
CHANGED
@@ -89,7 +89,7 @@ module FakeFS
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def self.size(path)
|
92
|
-
read(path).
|
92
|
+
read(path).bytesize
|
93
93
|
end
|
94
94
|
|
95
95
|
def self.size?(path)
|
@@ -134,8 +134,9 @@ module FakeFS
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
-
def self.expand_path(
|
138
|
-
|
137
|
+
def self.expand_path(file_name, dir_string=FileSystem.current_dir.to_s)
|
138
|
+
dir_string = FileSystem.find(dir_string).to_s
|
139
|
+
RealFile.expand_path(file_name, dir_string)
|
139
140
|
end
|
140
141
|
|
141
142
|
def self.basename(*args)
|
@@ -155,7 +156,7 @@ module FakeFS
|
|
155
156
|
file = new(path)
|
156
157
|
|
157
158
|
raise Errno::ENOENT if !file.exists?
|
158
|
-
raise Errno::EISDIR,
|
159
|
+
raise Errno::EISDIR, path if directory?(path)
|
159
160
|
|
160
161
|
FileSystem.find(path).atime = Time.now
|
161
162
|
file.read
|
@@ -173,16 +174,16 @@ module FakeFS
|
|
173
174
|
|
174
175
|
def self.rename(source, dest)
|
175
176
|
if directory?(source) && file?(dest)
|
176
|
-
raise Errno::ENOTDIR, "
|
177
|
+
raise Errno::ENOTDIR, "#{source} or #{dest}"
|
177
178
|
elsif file?(source) && directory?(dest)
|
178
|
-
raise Errno::EISDIR, "
|
179
|
+
raise Errno::EISDIR, "#{source} or #{dest}"
|
179
180
|
end
|
180
181
|
|
181
182
|
if target = FileSystem.find(source)
|
182
183
|
FileSystem.add(dest, target.entry.clone)
|
183
184
|
FileSystem.delete(source)
|
184
185
|
else
|
185
|
-
raise Errno::ENOENT,
|
186
|
+
raise Errno::ENOENT, "#{source} or #{dest}"
|
186
187
|
end
|
187
188
|
|
188
189
|
0
|
@@ -190,15 +191,15 @@ module FakeFS
|
|
190
191
|
|
191
192
|
def self.link(source, dest)
|
192
193
|
if directory?(source)
|
193
|
-
raise Errno::EPERM, "
|
194
|
+
raise Errno::EPERM, "#{source} or #{dest}"
|
194
195
|
end
|
195
196
|
|
196
197
|
if !exists?(source)
|
197
|
-
raise Errno::ENOENT, "
|
198
|
+
raise Errno::ENOENT, "#{source} or #{dest}"
|
198
199
|
end
|
199
200
|
|
200
201
|
if exists?(dest)
|
201
|
-
raise Errno::EEXIST, "
|
202
|
+
raise Errno::EEXIST, "#{source} or #{dest}"
|
202
203
|
end
|
203
204
|
|
204
205
|
source = FileSystem.find(source)
|
@@ -210,7 +211,7 @@ module FakeFS
|
|
210
211
|
|
211
212
|
def self.delete(file_name, *additional_file_names)
|
212
213
|
if !exists?(file_name)
|
213
|
-
raise Errno::ENOENT,
|
214
|
+
raise Errno::ENOENT, file_name
|
214
215
|
end
|
215
216
|
|
216
217
|
FileUtils.rm(file_name)
|
@@ -285,7 +286,7 @@ module FakeFS
|
|
285
286
|
|
286
287
|
def initialize(file, __lstat = false)
|
287
288
|
if !File.exists?(file)
|
288
|
-
raise
|
289
|
+
raise Errno::ENOENT, file
|
289
290
|
end
|
290
291
|
|
291
292
|
@file = file
|
@@ -307,6 +308,10 @@ module FakeFS
|
|
307
308
|
File.directory?(@file)
|
308
309
|
end
|
309
310
|
|
311
|
+
def file?
|
312
|
+
File.file?(@file)
|
313
|
+
end
|
314
|
+
|
310
315
|
def ftype
|
311
316
|
return 'link' if symlink?
|
312
317
|
return 'directory' if directory?
|
@@ -317,6 +322,7 @@ module FakeFS
|
|
317
322
|
def readable?
|
318
323
|
true
|
319
324
|
end
|
325
|
+
|
320
326
|
def writable?
|
321
327
|
true
|
322
328
|
end
|
@@ -515,12 +521,24 @@ module FakeFS
|
|
515
521
|
end
|
516
522
|
end
|
517
523
|
|
524
|
+
def read(length = nil, buf = "")
|
525
|
+
read_buf = super(length, buf)
|
526
|
+
if read_buf.respond_to?(:force_encoding) && binary_mode? #change to binary only for ruby 1.9.3
|
527
|
+
read_buf = read_buf.force_encoding('ASCII-8BIT')
|
528
|
+
end
|
529
|
+
read_buf
|
530
|
+
end
|
531
|
+
|
518
532
|
private
|
519
533
|
|
520
534
|
def check_modes!
|
521
535
|
StringIO.new("", @mode)
|
522
536
|
end
|
523
537
|
|
538
|
+
def binary_mode?
|
539
|
+
@mode.is_a?(String) && (@mode.include?('b') || @mode.include?('binary')) && !@mode.include?('bom')
|
540
|
+
end
|
541
|
+
|
524
542
|
def check_file_existence!
|
525
543
|
raise Errno::ENOENT, @path unless @file
|
526
544
|
end
|
@@ -540,7 +558,7 @@ module FakeFS
|
|
540
558
|
# Create a missing file if the path is valid.
|
541
559
|
#
|
542
560
|
def create_missing_file
|
543
|
-
raise Errno::EISDIR,
|
561
|
+
raise Errno::EISDIR, path if File.directory?(@path)
|
544
562
|
|
545
563
|
if !File.exists?(@path) # Unnecessary check, probably.
|
546
564
|
dirname = RealFile.dirname @path
|
@@ -549,7 +567,7 @@ module FakeFS
|
|
549
567
|
dir = FileSystem.find dirname
|
550
568
|
|
551
569
|
unless dir.kind_of? FakeDir
|
552
|
-
raise Errno::ENOENT,
|
570
|
+
raise Errno::ENOENT, path
|
553
571
|
end
|
554
572
|
end
|
555
573
|
|