This is what I have:
it "should be able to get a valid directory path" do
@asset.some_file_path.should == "/something/test.jpg"
end
The problem is that some_file_path returns "/not_here_yet.jpg" if there is no existing file.
def some_file_path
if File.exists(self.my_image_path)
return my_image_path
else
return "/not_here_yet.jpg
end
end
I don't really want to create a new file in my tests. Is there a way for me to fake the existence of the file?
I'm thinking something in the lines of :
it "should be able to get a valid directory path" do
AwesomeFakeFileCreator.create(@asset.my_image_path)
@asset.some_file_path.should == "/something/test.jpg"
end
Is this possible? How can I do such a thing?
Edit: I looked a bit at FakeFS but I'm not sure it answers my question