Categories
me me me programming ruby on rails tips

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.

Categories
me me me programming ruby on rails tips

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. 🙂

Categories
cathy cool design funny me me me sports

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. 🙂

Categories
programming ruby on rails tips

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.

Categories
cool funny technology video

Amazing sheep herding

This is just crazy. I wish I could find sheepdog trials on tv again.

[youtube:http://www.youtube.com/watch?v=D2FX9rviEhw]

Categories
funny mobile photography wtf?

Grafitti of a rocket ship seen on our walk

Grafitti of a rocket ship seen on our walk

I uploaded this through flickr

Categories
me me me mobile photography

View of our neighborhood from today’s walk

View of our neighborhood from today's walk

I uploaded this through flickr

Categories
cathy me me me mobile photography

Starting a saturday morning walk

Starting a saturday morning walk

I uploaded this through flickr

Categories
friends funny me me me video work

Birthday decoration of my cube at work

I came back from a weekend away for my birthday to find my cube looking like this. I have awesome coworkers.

[youtube:http://www.youtube.com/watch?v=zuG0tOrSrOU]

Categories
me me me

Psychic Wallpaper

Psychic Wallpaper

How does my computer know that yesterday was my birthday. Creepy. 🙂 The upper left picture was a dessert that my Sister-In-Law made for me when we stayed at the hotel where she used to be a chef.

I uploaded this through flickr