 <ol> <li>Use <a href="http://ruby-doc.org/stdlib-2.3.0/libdoc/fileutils/rdoc/FileUtils.html#method-c-mkdir" rel="nofollow">ruby tools</a> for creating directory instead of shelling out.</li> <li>Move your expectation into the fakefs block.</li> </ol>