How to write your first acceptance test

Rubyists always talk about testing. The growth of Ruby (and Rails) came at a time when automated testing and agile development also came to the fore. And much of the flexibility around agile depends upon being able to safely make changes to your development plan after the project has started. But testing is not easy…. Continue reading

The easy way to get started with automated testing

You love Ruby. A beautiful language, object orientated with a light sprinkling of functional features. The community is nice. But there’s a nagging doubt in the back of your mind. Real Rubyists use tests TDD, BDD, RSpec, Capybara … you’re not a rubyist if you don’t write tests. That’s what the cool kids say. And… Continue reading

Switching from RSpec to Minitest

I like the “specification” style of testing – it makes more sense to me than the “assertion” style. But I’ve recently switched from RSpec to Minitest (with Mocha). Why? RSpec is huge. It makes lovely tests that read like English, but it’s huge. Plus its recent switch from object.should == something to expect(object).to be ==… Continue reading

The problem with ActiveRecord

The time before ActiveRecord I may be showing my age but I remember the time before Active Record. You would either write raw SQL statements, which for a table with many fields meant a lot of tedious typing, plus the ever-present danger of SQL injection bugs. Or you could use an early Object-Relational Mapper, which… Continue reading

How to write a full-stack test (part two)

Many people don’t like the Gherkin/Spinach/Cucumber approach to testing. Why write the thing out in English and then just convert it to code? Why set up the database and test environment configuration twice? Cucumber’s step files are unmanageable! To the first comment, I think I’ve explained why I prefer it. It’s describing the problem, taking… Continue reading