FakeFS unusable with Rubinius and File.readable?() #2872

Closed
ghost opened this Issue Jan 5, 2014 · 4 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Jan 5, 2014

I think the current release of FakeFS might be completely unusable on rubinius.
i pulled this out of some code I'm working on:

require "fakefs"
dir = FakeFS::FileSystem.add ENV["HOME"]
file = FakeFS::FakeFile.new "hello.txt"
dir[file.name] = file
file.content = "quack"
File.readable?(file)

error:

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:
defunkt/fakefs#87 (comment)

I find FakeFS really useful. is there anything it can do to work better on rubinius?

@ghost

ghost commented Jan 5, 2014

I can see another bug inside that #inspect. you can see size is 5, but it should actually be 1.

@ghost

ghost commented Jan 5, 2014

oh nevermind, size of the file, not the directory.

@ghost ghost referenced this issue in fakefs/fakefs Jan 9, 2014

Open

partially/completely broken on Rubinius #211

@ghost

ghost commented Jan 10, 2014

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.

Owner

brixen commented Dec 28, 2015

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.

@brixen brixen closed this Dec 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment