Closed pabloh closed 11 years ago
This would also allow only do require 'bundler/setup'
at spec_helper.rb instead of doing
require 'bundler'
Bundler.require :default, :test
Maybe I could add a commit to update the README file if you want.
@pat, @parndt: no comment about this so far?
I think could settle for at least some mean to execute code after the rails modules are loaded but before Combustion::Application.initialize! is run. Like having some Combustion attribute where you could pass a block to be run, or maybe passing a block to Combustion.initialize! directly.
@pabloh I'd be open to the idea of passing a block to Combustion.initialize
that gets called just prior to Combustion::Application.initialize!
. That feels a bit cleaner than this approach of guessing the gem name and loading it.
@pat I changed commits I originally sent. Do you think the current changes are acceptable?, I'm basically calling 'Bundler.require' after requiring the rails modules and just before calling Application.initialize!. I also updated the README since the source of the problem I was having was when calling 'Bundler.require :default, :test' at the spec_helper.rb file.
The other approach of yielding a block just before calling Application.initialize!, will also work but I think this one is simpler.
@pat @parndt , any feedback on this?
One (potential?) snag is that this binds us to Bundler inside of Combustion's source code whereas we previously weren't.
@parndt, since when using rails you're already heavily binded to bundler, I don't understand how that could be a problem.
I've merged this in - I agree that we're pretty closely tied to Bundler anyway, as that's what Rails uses and this gem's all about testing Rails-related libraries.
This fixes issues like https://github.com/pat/combustion/issues/27. Without having to do to any work around.