Rake, bundler and File.dirname(__FILE__)
I noticed the other day on a project I'm working on that tests would work fine when called by rake, but failed with bundle and guard. Turns out File.dirname(__FILE__)
is based on the location of the initializing script. To fix the tests for all environments try this: File.dirname(File.realdirpath(__FILE__))
Written by Jason Porter
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#