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
data/test/file/stat_test.rb
CHANGED
@@ -23,12 +23,17 @@ class FileStatTest < Test::Unit::TestCase
|
|
23
23
|
File.link(*args)
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def test_file_stat_init_with_non_existent_file
|
27
27
|
assert_raises(Errno::ENOENT) do
|
28
28
|
File::Stat.new("/foo")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
def test_file_should_be_true_when_file
|
33
|
+
touch("/foo")
|
34
|
+
assert File::Stat.new("/foo").file?
|
35
|
+
end
|
36
|
+
|
32
37
|
def test_symlink_should_be_true_when_symlink
|
33
38
|
touch("/foo")
|
34
39
|
ln_s("/foo", "/bar")
|
data/test/test_helper.rb
CHANGED
@@ -13,3 +13,19 @@ def act_on_real_fs
|
|
13
13
|
yield
|
14
14
|
FakeFS.activate!
|
15
15
|
end
|
16
|
+
|
17
|
+
def capture_stderr
|
18
|
+
real_stderr, $stderr = $stderr, StringIO.new
|
19
|
+
|
20
|
+
# force FileUtils to use our stderr
|
21
|
+
RealFileUtils.instance_variable_set('@fileutils_output', $stderr)
|
22
|
+
|
23
|
+
yield
|
24
|
+
|
25
|
+
return $stderr.string
|
26
|
+
ensure
|
27
|
+
$stderr = real_stderr
|
28
|
+
|
29
|
+
# restore FileUtils stderr
|
30
|
+
RealFileUtils.instance_variable_set('@fileutils_output', $stderr)
|
31
|
+
end
|
metadata
CHANGED
@@ -1,23 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakefs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Wanstrath
|
9
8
|
- Scott Taylor
|
10
9
|
- Jeff Hodges
|
11
10
|
- Pat Nakajima
|
11
|
+
- Brian Donovan
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
|
-
name:
|
18
|
+
name: bundler
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '1.3'
|
24
|
+
type: :development
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '1.3'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: rake
|
19
33
|
requirement: !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
34
|
requirements:
|
22
35
|
- - ! '>='
|
23
36
|
- !ruby/object:Gem::Version
|
@@ -25,15 +38,13 @@ dependencies:
|
|
25
38
|
type: :development
|
26
39
|
prerelease: false
|
27
40
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
41
|
requirements:
|
30
42
|
- - ! '>='
|
31
43
|
- !ruby/object:Gem::Version
|
32
44
|
version: '0'
|
33
45
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
46
|
+
name: rspec
|
35
47
|
requirement: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
48
|
requirements:
|
38
49
|
- - ! '>='
|
39
50
|
- !ruby/object:Gem::Version
|
@@ -41,7 +52,6 @@ dependencies:
|
|
41
52
|
type: :development
|
42
53
|
prerelease: false
|
43
54
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
55
|
requirements:
|
46
56
|
- - ! '>='
|
47
57
|
- !ruby/object:Gem::Version
|
@@ -49,7 +59,6 @@ dependencies:
|
|
49
59
|
- !ruby/object:Gem::Dependency
|
50
60
|
name: rdiscount
|
51
61
|
requirement: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
62
|
requirements:
|
54
63
|
- - ! '>='
|
55
64
|
- !ruby/object:Gem::Version
|
@@ -57,25 +66,23 @@ dependencies:
|
|
57
66
|
type: :development
|
58
67
|
prerelease: false
|
59
68
|
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
69
|
requirements:
|
62
70
|
- - ! '>='
|
63
71
|
- !ruby/object:Gem::Version
|
64
72
|
version: '0'
|
65
73
|
description: A fake filesystem. Use it in your tests.
|
66
|
-
email:
|
74
|
+
email:
|
75
|
+
- chris@ozmm.org
|
67
76
|
executables: []
|
68
77
|
extensions: []
|
69
|
-
extra_rdoc_files:
|
70
|
-
- LICENSE
|
71
|
-
- README.markdown
|
78
|
+
extra_rdoc_files: []
|
72
79
|
files:
|
73
80
|
- .autotest
|
81
|
+
- .gitignore
|
74
82
|
- .rspec
|
75
83
|
- .travis.yml
|
76
84
|
- CONTRIBUTORS
|
77
85
|
- Gemfile
|
78
|
-
- Gemfile.lock
|
79
86
|
- LICENSE
|
80
87
|
- README.markdown
|
81
88
|
- Rakefile
|
@@ -94,6 +101,7 @@ files:
|
|
94
101
|
- lib/fakefs/safe.rb
|
95
102
|
- lib/fakefs/spec_helpers.rb
|
96
103
|
- lib/fakefs/version.rb
|
104
|
+
- spec/fakefs/fakefs_bug_ruby_2.1.0-preview2_spec.rb
|
97
105
|
- spec/fakefs/spec_helpers_spec.rb
|
98
106
|
- spec/spec.opts
|
99
107
|
- spec/spec_helper.rb
|
@@ -110,30 +118,44 @@ files:
|
|
110
118
|
- test/test_helper.rb
|
111
119
|
- test/verify.rb
|
112
120
|
homepage: http://github.com/defunkt/fakefs
|
113
|
-
licenses:
|
121
|
+
licenses:
|
122
|
+
- MIT
|
123
|
+
metadata: {}
|
114
124
|
post_install_message:
|
115
125
|
rdoc_options: []
|
116
126
|
require_paths:
|
117
127
|
- lib
|
118
128
|
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
-
none: false
|
120
129
|
requirements:
|
121
130
|
- - ! '>='
|
122
131
|
- !ruby/object:Gem::Version
|
123
132
|
version: '0'
|
124
|
-
segments:
|
125
|
-
- 0
|
126
|
-
hash: -790320842587735539
|
127
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
-
none: false
|
129
134
|
requirements:
|
130
135
|
- - ! '>='
|
131
136
|
- !ruby/object:Gem::Version
|
132
137
|
version: '0'
|
133
138
|
requirements: []
|
134
139
|
rubyforge_project:
|
135
|
-
rubygems_version:
|
140
|
+
rubygems_version: 2.2.0
|
136
141
|
signing_key:
|
137
|
-
specification_version:
|
142
|
+
specification_version: 4
|
138
143
|
summary: A fake filesystem. Use it in your tests.
|
139
|
-
test_files:
|
144
|
+
test_files:
|
145
|
+
- spec/fakefs/fakefs_bug_ruby_2.1.0-preview2_spec.rb
|
146
|
+
- spec/fakefs/spec_helpers_spec.rb
|
147
|
+
- spec/spec.opts
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
- test/fake/file/join_test.rb
|
150
|
+
- test/fake/file/lstat_test.rb
|
151
|
+
- test/fake/file/stat_test.rb
|
152
|
+
- test/fake/file/sysseek_test.rb
|
153
|
+
- test/fake/file/syswrite_test.rb
|
154
|
+
- test/fake/file_test.rb
|
155
|
+
- test/fake/symlink_test.rb
|
156
|
+
- test/fakefs_test.rb
|
157
|
+
- test/file/stat_test.rb
|
158
|
+
- test/safe_test.rb
|
159
|
+
- test/test_helper.rb
|
160
|
+
- test/verify.rb
|
161
|
+
has_rdoc:
|
data/Gemfile.lock
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
diff-lcs (1.1.3)
|
5
|
-
git (1.2.5)
|
6
|
-
jeweler (1.8.4)
|
7
|
-
bundler (~> 1.0)
|
8
|
-
git (>= 1.2.5)
|
9
|
-
rake
|
10
|
-
rdoc
|
11
|
-
json (1.7.5)
|
12
|
-
rake (10.0.0)
|
13
|
-
rdiscount (1.6.8)
|
14
|
-
rdoc (3.12)
|
15
|
-
json (~> 1.4)
|
16
|
-
rspec (2.12.0)
|
17
|
-
rspec-core (~> 2.12.0)
|
18
|
-
rspec-expectations (~> 2.12.0)
|
19
|
-
rspec-mocks (~> 2.12.0)
|
20
|
-
rspec-core (2.12.0)
|
21
|
-
rspec-expectations (2.12.0)
|
22
|
-
diff-lcs (~> 1.1.3)
|
23
|
-
rspec-mocks (2.12.0)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
jeweler
|
30
|
-
rdiscount
|
31
|
-
rspec
|