Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is: /Users/ngw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:446:in `realpath'': undefined method `realpath'' for FakeFS::File:Class (NoMethodError) Is it a problem with my version of Ruby ? If it is, how do I test this stuff ? It''s very annoying to have the files saved in /public for every autotest I run ... TIA, ngw
How are you requiring FakeFS? Scott On Mar 13, 2011, at 10:30 AM, Nicholas Wieland wrote:> Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? > I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is: > > /Users/ngw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:446:in `realpath'': undefined method `realpath'' for FakeFS::File:Class (NoMethodError) > > Is it a problem with my version of Ruby ? If it is, how do I test this stuff ? It''s very annoying to have the files saved in /public for every autotest I run ... > > TIA, > ngw > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
hi Scott, thanks for the answer. https://gist.github.com/868356 I''m not even calling it inside the specs. ngw On Mar 13, 2011, at 5:28 PM, Scott Taylor wrote:> > How are you requiring FakeFS? > > Scott > > On Mar 13, 2011, at 10:30 AM, Nicholas Wieland wrote: > >> Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? >> I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is: >> >> /Users/ngw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:446:in `realpath'': undefined method `realpath'' for FakeFS::File:Class (NoMethodError) >> >> Is it a problem with my version of Ruby ? If it is, how do I test this stuff ? It''s very annoying to have the files saved in /public for every autotest I run ... >> >> TIA, >> ngw >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
I think the problem is a missing API in FakeFS: http://rubydoc.info/gems/fakefs/0.3.1/FakeFS/File http://www.ruby-doc.org/core/classes/File.html#M000024 On Mar 13, 2011, at 2:37 PM, Nicholas Wieland wrote:> hi Scott, thanks for the answer. > > https://gist.github.com/868356 > > I''m not even calling it inside the specs. > > ngw > > On Mar 13, 2011, at 5:28 PM, Scott Taylor wrote: > >> >> How are you requiring FakeFS? >> >> Scott >> >> On Mar 13, 2011, at 10:30 AM, Nicholas Wieland wrote: >> >>> Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? >>> I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is: >>> >>> /Users/ngw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:446:in `realpath'': undefined method `realpath'' for FakeFS::File:Class (NoMethodError) >>> >>> Is it a problem with my version of Ruby ? If it is, how do I test this stuff ? It''s very annoying to have the files saved in /public for every autotest I run ... >>> >>> TIA, >>> ngw >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersCheers, David
On Sun, Mar 13, 2011 at 10:30 AM, Nicholas Wieland <ngw at nofeed.org> wrote:> Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? > I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is:An alternative you might try is Construct: https://github.com/devver/construct We created it at Devver because we had trouble with libraries like FakeFS. Instead of faking out the FS, it simply gives you tools to set up the needed file structures and then automatically clean them up when the test is done. -- Avdi Grimm http://avdi.org
On 13 Mar 2011, at 22:05, Avdi Grimm wrote:> On Sun, Mar 13, 2011 at 10:30 AM, Nicholas Wieland <ngw at nofeed.org> wrote: >> Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? >> I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is: > > An alternative you might try is Construct: https://github.com/devver/construct > > We created it at Devver because we had trouble with libraries like > FakeFS. Instead of faking out the FS, it simply gives you tools to set > up the needed file structures and then automatically clean them up > when the test is done.I wonder if you could similarly use Aruba''s library for that in RSpec. It might need some tweaks.> > -- > Avdi Grimm > http://avdi.org > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-userscheers, Matt matt at mattwynne.net 07974 430184
Agreed with David - it simply hasn''t been implemented in FakeFS. I''m actually a maintainer on the project, but don''t have any steam to work on it right now. I''d certainly apply patches, though. FakeFS is a project of gradual enhancement, so even a patch that doesn''t respect all of the arguments / features of File.realpath is OK. We can always fix it / improve it later. Cheers, Scott On Mar 13, 2011, at 5:32 PM, David Chelimsky wrote:> I think the problem is a missing API in FakeFS: > > http://rubydoc.info/gems/fakefs/0.3.1/FakeFS/File > http://www.ruby-doc.org/core/classes/File.html#M000024 > > On Mar 13, 2011, at 2:37 PM, Nicholas Wieland wrote: > >> hi Scott, thanks for the answer. >> >> https://gist.github.com/868356 >> >> I''m not even calling it inside the specs. >> >> ngw >> >> On Mar 13, 2011, at 5:28 PM, Scott Taylor wrote: >> >>> >>> How are you requiring FakeFS? >>> >>> Scott >>> >>> On Mar 13, 2011, at 10:30 AM, Nicholas Wieland wrote: >>> >>>> Hi *, for some reasons I''m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? >>>> I''m currently trying to use FakeFS, but apparently I''m not even able to run specs after changing spec_helper. The exception it raises is: >>>> >>>> /Users/ngw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:446:in `realpath'': undefined method `realpath'' for FakeFS::File:Class (NoMethodError) >>>> >>>> Is it a problem with my version of Ruby ? If it is, how do I test this stuff ? It''s very annoying to have the files saved in /public for every autotest I run ... >>>> >>>> TIA, >>>> ngw >>>> _______________________________________________ >>>> rspec-users mailing list >>>> rspec-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > Cheers, > David > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users