[rspec-devel] require 'rubygems'

David Chelimsky dchelimsky at gmail.com
Thu Mar 26 07:04:04 EDT 2009

On Thu, Mar 26, 2009 at 4:08 AM, Jim Weirich <jim.weirich at gmail.com> wrote:
> On Mar 26, 2009, at 3:04 AM, David Chelimsky wrote:
>> That's essentially what's happening in this branch, though it's
>> wrapped in a method to reduce duplication.
> Duplication?  How many places need to do this?
> Seems to me that any libraries don't need this.  By the time the libraries
> are loading, rubygems should already be loaded (otherwise the libraries
> wouldn't have been found).
> I only put this in the top level application code.  One place.
> At least this is true for rake.  Is rspec different?

There are several cases of libraries that rspec only needs to load
with certain command line options. These libraries get loaded by
rspec's options before any of *your* files are loaded, so even if you
require 'rubygems' from a spec_helper it won't happen until after we
need those files. We could, of course, change that strategy to reduce
this duplication, but that would require a fair bit more re-thinking
than needs happen before this issue is decided.

> --
> -- Jim Weirich
> -- jim.weirich at gmail.com
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the rspec-devel mailing list