diff --git a/lib/memfs.rb b/lib/memfs.rb
index <HASH>..<HASH> 100644
--- a/lib/memfs.rb
+++ b/lib/memfs.rb
@@ -78,6 +78,9 @@ module MemFs
       const_set :Dir,  MemFs::Dir
       const_set :File, MemFs::File
     end
+
+    MemFs::File.umask(MemFs::OriginalFile.umask)
+    MemFs::FileSystem.instance.clear!
   end
 
   # Deactivates the fake file system.
diff --git a/spec/memfs_spec.rb b/spec/memfs_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/memfs_spec.rb
+++ b/spec/memfs_spec.rb
@@ -35,6 +35,10 @@ describe MemFs do
     it "replaces Ruby File class with a fake one" do
       expect(::File).to be(MemFs::File)
     end
+
+    it "sets the umask to the same value than the system one" do
+      expect(MemFs::File.umask).to eq(MemFs::OriginalFile.umask)
+    end
   end
 
   describe '.deactivate!' do
Setting up the MemFs boilerplate