Forum: Ruby on Rails bet way to debug a plug-in?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gama F. (Guest)
on 2009-01-07 12:00
(Received via mailing list)
Hi,

Yesterday I had to walk through the code of a plug-in and perform a
minor fix. I confess that I
didn't like the experience. Because the plug-in is in the vendor
directory, I
had to restart the web server whenever the code changed.

How can I debug a plug-in without having to restart the web server
whenever the code changes?

Thanks,
  Tiago F.
(Guest)
on 2009-01-07 12:24
(Received via mailing list)
one way to bypass the server problem is to run tests.  Normally
there's a test (or rspec) suite included.  If not, you can create it
- create a test directory (or spec)
- include a test_helper.rb or spec_helper.rb (take one from another
plugin)
- make unit tests that require the test or spec helper and inherit
from a unit test case.
- run rake (or rake spec) in your plugin directory

Elise

And then you add tests that correspond to your fix, and run until it's
working as required.
This topic is locked and can not be replied to.