./.bashrc's and the following line at the end of
~/.bashrcSo, to make this technique complete (and to support login shells starting from non-home directories, like with Terminal.app's Resume), you must also add the following line at the beginning of
It seems ruby-debug has fallen out of favour with the community and the replacement is byebug.
So here's my follow-up on the old post.
The steps to enable byebugging in your app dev env:
- echo export POW_WORKERS=1 >> ~/.powconfig # make sure pow runs only one app process — globally
- cd <your project directory>
- Add byebug to your bundle (and remove ruby-debug if exists).
- Paste the following snippet at the end of your config/environments/development.rb — for rails, or in the appropriate development environment initialisation module — for the platform of your choice:
- echo export RUBY_DEBUG_PORT=10007 >> .powenv # make sure we enable debugging with a machine-unique port, e.g. 10007 (you should pick different ports for different projects)
- touch tmp/restart.txtThen make any request to actually restart your server.
- byebug -R localhost:10007 -d # you're back in business, go wild with debugger's in your code
I've come to use a nice gem called mail_view for visual testing of email templates in Rails.
I think it is totally legit and desirable to re-use that code in the views testing suite, so here we go:
(provided that your
MailView's subclass is
MailPreview, put this in
This just checks for the lack of exceptions and any content, but it's a starting point.
p.s. A nice complementary pull request of mine is here.
Now put this in
config/initializers/i18n_test.rb and spec it!
N.B. Curiously enough, a similar technique is needed for 4.0 as well.
P.S. Tested and working with Rails 4.0-stable, yay!