Skip to content

Commit 33d8283

Browse files
Merge pull request fakefs#128 from loe/readme
Update Readme: How to integrate with other filesystem libraries.
2 parents 93a8f9e + 8a78b9b commit 33d8283

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.markdown

+16-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ FakeFS::SpecHelpers to turn FakeFS on and off in a given example group:
7070
See `lib/fakefs/spec_helpers.rb` for more info.
7171

7272

73+
Integrating with other file system libraries
74+
--------------------------------------------
75+
Libraries like [FileMagic](https://rubygems.org/gems/ruby-filemagic) add
76+
additional functionality to the File class. These should be monkey-patched in
77+
your test harness' helper file.
78+
79+
module FakeFS
80+
class File
81+
def content_type
82+
'fake/file'
83+
end
84+
end
85+
end
86+
87+
7388
How is this different than MockFS?
7489
----------------------------------
7590

@@ -134,4 +149,4 @@ Releasing
134149

135150
1. Update version in lib/fakefs/version.rb
136151
2. Commit it
137-
3. rake publish
152+
3. rake publish

0 commit comments

Comments
 (0)