David Chelimsky
2010-May-26 13:23 UTC
[rspec-users] should RSpec add ''.'' to $LOAD_PATH for ruby-1.9.2?
Ruby-1.9.2 removes ''.'' from the $LOAD_PATH. There have been a couple of issues reported against rspec-core-2 asking RSpec to add ''.'' to $LOAD_PATH for 1.9.2. My instinct is that this is the wrong way to go; that Ruby is telling us to get used to typing "./" when we run command line tools. What do _you_ think? ================http://github.com/rspec/rspec-core/issues/issue/28 http://github.com/rspec/rspec-core/issues/issue/29
John Feminella
2010-May-26 14:00 UTC
[rspec-users] should RSpec add ''.'' to $LOAD_PATH for ruby-1.9.2?
I''ve updated my tests for 1.9.2, and although initially I thought it was obnoxious, it''s a very sensible change. If `.` is in `$:`, then your `require` line needs to change depending on where you run rspec (or any other command invoking your Ruby scripts) from. What''s much more sensible is to replace all usages of `require ''...''` that depend on `.` with a `require_relative` directive instead. ~ jf -- John Feminella Principal Consultant, Distilled Brilliance On Wed, May 26, 2010 at 09:23, David Chelimsky <dchelimsky at gmail.com> wrote:> Ruby-1.9.2 removes ''.'' from the $LOAD_PATH. There have been a couple of issues reported against rspec-core-2 asking RSpec to add ''.'' to $LOAD_PATH for 1.9.2. My instinct is that this is the wrong way to go; that Ruby is telling us to get used to typing "./" when we run command line tools. What do _you_ think? > > ================> http://github.com/rspec/rspec-core/issues/issue/28 > http://github.com/rspec/rspec-core/issues/issue/29 > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2010-May-26 14:18 UTC
[rspec-users] should RSpec add ''.'' to $LOAD_PATH for ruby-1.9.2?
On May 26, 2010, at 8:23 AM, David Chelimsky wrote:> Ruby-1.9.2 removes ''.'' from the $LOAD_PATH. There have been a couple of issues reported against rspec-core-2 asking RSpec to add ''.'' to $LOAD_PATH for 1.9.2. My instinct is that this is the wrong way to go; that Ruby is telling us to get used to typing "./" when we run command line tools. What do _you_ think? > > ================> http://github.com/rspec/rspec-core/issues/issue/28 > http://github.com/rspec/rspec-core/issues/issue/29Upon further review (d''oh), it turns out there is a solution for this already built into rspec-2. Just add a .rspec file in the project root (or home directory for global settings) and add a line that reads "-I.". I''ll make sure this is documented in the README. Cheers, David