Category Archives: Rails

Turns out, cucumber/webrat is worse

At CDD we use a fairly strange stack to run our automated in-browser (Selenium RC) integration tests. When we started writing these tests back in 2007, we used the best technology we knew of that was then available, a Rails … Continue reading

Posted in Rails, Testing | Leave a comment

Too many mock objects == ruby refactoring death

It’s a question we face as test-driven ruby programmers: Should we use mock objects or real objects in our tests? Both approaches have trade-offs, and their biggest downsides both have to do with wasting programmer time. If you test with … Continue reading

Posted in Rails, Software, Testing | 4 Comments

MacPorts Ruby, now with DTrace

We are gearing up to do some profiling/performance improvement at work, and we use MacPorts (mostly at my stubborn insistence) to install Ruby on our OS X dev boxes. Unfortunately, the MacPorts version of Ruby is not DTrace-enabled, so we … Continue reading

Posted in Rails, Software | Tagged | Leave a comment

Chained Selenium RSpec examples

From the RSpec documentation: It is very tempting to use before(:all) and after(:all) for situations in which it is not appropriate. before(:all) shares some (not all) state across multiple examples. This means that the examples become bound together, which is … Continue reading

Posted in Rails, Testing | 7 Comments

Keeping Rails migrations happy

Two quick things we’ve learned about migrations at CDD: Avoid using your model objects in your migrations, e.g. stuff like Group.create!(:name => “Watson Lab”). The problem with this is that later you might add a required field to your model, … Continue reading

Posted in Rails | Leave a comment