--- a/lib/fakefs/file.rb +++ b/lib/fakefs/file.rb @@ -1,3 +1,5 @@ +require 'stringio' unless defined? StringIO + module FakeFS class File PATH_SEPARATOR = '/' The following Rakefile change extracted from https://github.com/defunkt/fakefs/commit/82db05e85d1a486fbdb6: --- a/Rakefile +++ b/Rakefile @@ -1,2 +1,4 @@ +$LOAD_PATH.unshift File.join(File.dirname(__FILE__)) + desc "Run tests" task :test do --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -288,7 +288,7 @@ assert_nil File.size?("/path/to/other.txt") end - def test_can_check_size?_of_empty_file + def test_can_check_size_of_empty_file path = '/path/to/file.txt' File.open(path, 'w') do |f| f << ''