Efficient Rails Test-Driven Development, Class 1 of 6

Posted on Nov 8, 2010 (3 years ago). Seen 6,617 times. One comment. Permalink Feed
Photo Max Walker
Director of Marketing
NewCircle, Inc.
Member since Sep 29, 2010
Location: San Francisco
Stream Posts: 295
Tagged as: Ruby TDD Tutorial Video
This video is of Class 1 from Wolfram Arnold's stellar six-week class Efficient Rails Test-Driven Development, which he taught at BlazingCloud back in July 2010.

In this series, experienced Rails engineer and consultant, Wolfram Arnold applies a real-world perspective to teaching you effective patterns for TDD.

In this first of six classes, Wolf covers:
  • The economics of testing
  • Testing in layers, design patterns
  • Toolbox: RSpec with Rails
  • RSpec & Models

Each week, we'll make the next video in this series available online. So, stay tuned! In the meantime, stop by TechTV to satisfy your hunger for great educational content on open source development.

Class 1 Class 2 Class 3 Class 4 Class 5 Class 6


You can grab the source code for these classes here.

Here's the video for Class 1:



...and here are the slides:

This post is part of Efficient Rail Test-Driven Development Course.

Comments

Posted on Jun 24, 2012
Photo Gerard Caulfield
NA
Member since Jun 24, 2012
If you use the spec suggested at 1:22:00 (and in the code on Github)

Code:
it 'must have a first_name' do
p = Person.new
p.should_not be_valid # calls p.valid?
p.errors.on(:first_name).should_not be_nil
end

it 'must have a last_name' do
p = Person.new
p.should_not be_valid # calls p.valid?
p.errors.on(:last_name).should_not be_nil
end


...you could remove one? of the validates_presence_of checks for first_name or last_name and it will still pass, which is funny as this is the spec that was meant to lead to adding validates_presence_of through tdd. One of the students mentioned this in the vid, which was why the errors.on check was added, but this addresses the wrong problem. ...I think.

Otherwise fantastic vid, thanks heaps for sharing it with us.