April, 2009


29
Apr 09

Winning tickets to a concert makes my wife go a little crazy

… it makes her say things she NEVER says, like “Right on!” :)

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.


22
Apr 09

A Coke and a body bag

A Coke and a body bag

I uploaded this through flickr


20
Apr 09

Clement Freud’s funniest joke

from The Telegraph via Boing Boing


9
Apr 09

Fixing Snarl and autotest_menu in windows

I’ve been trying to get ZenSpider autotest and Windows to play nice for a while. First, I had the problem where autotest would only run once and not stick around waiting for updates to my code. That was fixed by Luke Pearce. He commented on a previous post with his fix and I can confirm that it works. Thanx Luke!

I encountered another problem now. When I ran my autotest but tried to shut it down by hitting Control-C twice in a row, the tests would just reset and run again. Double Control-C is supposed to interrupt the process and allow me to shut it down. This it did not do.
Continue reading →


6
Apr 09

Turning off the Rails 2.3.2 BacktraceCleaner

I had a situation today where, when running some functional tests, the error backtrace being displayed was not helpful at ALL. I was defining a layout for a controller as a symbol instead of a string like I should have been using. You use a string when you are just saying “Use this layout” and you use a symbol when you have a method to call that responds with the layout to use. The error I was getting was …

NoMethodError: undefined method `admin' for #<Admin::RegistrationsController>

but what was the first line that came up in the backtrace?

app/controllers/admin/registrations_controller.rb:18:in `show'

This was giving me fits. There’s no call to ‘admin’ in the ’show’ method. I knew there had to be something else so I searched for how to see more of the backtrace.

The BacktraceCleaner introduced in Rails 2.3.2 cleans out backtrace lines coming from the Rails framework (Railties, etc). This is usually what you want. However, I was sure that my error was coming from somewhere in the framework. Turns out it’s really simple to turn off the backtrace cleaner. Add this line in a ’setup’ method in your test_helper.rb file.

Rails.backtrace_cleaner.remove_silencers!

Very simple, very easy. My name is Chef Tell. :)


6
Apr 09

Gun range owners need to print up some of these

Cathy and I have, off and on, talked about going to a gun range to see what it’s like. I’ve shot a rifle before but only once. It was skeet shooting and to say I wasn’t anywhere near the target is an understatement. I’m much better at the Wii Sports target shooting game.

I bet if gun range owners got a few of these for targets, I’d be able to hit ‘em. :)


2
Apr 09

Rails 2.3.2 and testing with assert_select_email

I upgraded a project to Rails 2.3.2 a while back and have been getting the following error when running some unit tests…

NoMethodError: undefined method `assert_select_email' for #<UserMailerTest>

I posted to the rubyonrails-talk google group but never got a response, and I was not the first to post about this problem to that group. However I found someone else commenting on this in an rspec lighthouse ticket and they’d fixed it for their setup. It was an easy conversion to non-rspec and here’s the line you need to add to your test/test_helper.rb file

include ActionController::Assertions::SelectorAssertions

I’m not sure why it’s broken but it appears to have regressed in one of the Rails 2.3.2 RCs.