GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I think the current release of FakeFS might be completely unusable on rubinius.
i pulled this out of some code I'm working on:
dir = FakeFS::FileSystem.add ENV["HOME"]
file = FakeFS::FakeFile.new "hello.txt"
dir[file.name] = file
file.content = "quack"
An exception occurred running x.rb:
Coercion error: (FakeFile name:"hello.txt" parent:"" size:5).to_str => String failed (TypeError)
it looks like bugs being likely are expected on rubinius from the comment here:
I find FakeFS really useful. is there anything it can do to work better on rubinius?
I can see another bug inside that #inspect. you can see size is 5, but it should actually be 1.
oh nevermind, size of the file, not the directory.
I opened an issue on defunkt/fakefs, as can you see from the notification above me. maybe there's improvements it can make to play well with rubinius.
FakeFS assumes that it can overwrite or manipulate essential Ruby classes and methods. This works on MRI because those are a very thin veneer on top of C functions. That's not the case in Rubinius, where the classes and methods are Ruby classes and methods.
Using MRI is a good option if FakeFS is needed.