gma / tconsole

Testing console for Rails. Helps out with test performance and also makes it easier to run specific tests
177 stars 18 forks source link

tconsole> reload doesn't reload the bundle #73

Closed kalashnikovisme closed 11 years ago

kalashnikovisme commented 11 years ago

Reload doesn't work after "bundle". TConsole doesn't see new gems.

I've add gem 'pry' to Gemfile

tconsole> all
1) Error:
EventsControllerTest#test_should_not_create_event_with_render_new (2-6):  
NoMethodError: undefined method `pry' for #<Binding:0x00000004dfb840>
...

> bundle install
> tconsole all
1) Error:
EventsControllerTest#test_should_not_create_event_with_render_new (2-6):  
NoMethodError: undefined method `pry' for #<Binding:0x00000004dfb840>
gma commented 11 years ago

Does it say somewhere that it should reload your entire bundle? I suspect it's only supposed to reload your application code.

kalashnikovisme commented 11 years ago

@gma is supposes changing my application code without reload. Why reload?

gma commented 11 years ago

I only took over maintenance of tconsole recently and haven't really dug into the code yet, but I just investigated exactly what reload does.

It appears as though the reload command is primarily there to reload the TConsole config file. Have a look at the load_environment method here: https://github.com/gma/tconsole/blob/6d46b7cb85586c43635fedbe740b898fc1348456/lib/tconsole/server.rb#L28

Lines 41 to 48 look like the most significant; files that you may have added to a .tconsole file will get loaded, for example.

There's nothing in there about starting a new Ruby process (which would reload the bundle) or asking Bundler to do that. I'm not even sure if Bundler supports that.

My recommendation would be to just quit TConsole and restart it, as you need to do with any bundled Ruby app.

kalashnikovisme commented 11 years ago

@gma thank you.