Introduction to RSpec

Sean Cribbs and Joshua French
Kansas City Ruby User Group

Intro to BDD

http://dannorth.net/introducing-bdd

Intro to BDD

I had a problem. While using and teaching agile practices like test-driven development (TDD) on projects in different environments, I kept coming across the same confusion and misunderstandings. Programmers wanted to know where to start, what to test and what not to test, how much to test in one go, what to call their tests, and how to understand why a test fails.

Intro to BDD

The deeper I got into TDD, the more I felt that my own journey had been less of a wax-on, wax-off process of gradual mastery than a series of blind alleys. I remember thinking “If only someone had told me that!” far more often than I thought “Wow, a door has opened.” I decided it must be possible to present TDD in a way that gets straight to the good stuff and avoids all the pitfalls.

Intro to BDD

My response is behaviour-driven development (BDD). It has evolved out of established agile practices and is designed to make them more accessible and effective for teams new to agile software delivery. Over time, BDD has grown to encompass the wider picture of agile analysis and automated acceptance testing.

Intro to BDD

Intro to BDD

Intro to BDD

Intro to BDD

Intro to BDD

Intro to BDD

Intro to BDD

Intro to BDD

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Test::Unit vs. RSpec

Live Coding Session

Filling out your RSpec toolbox

Scenarios

Salve for your fixture pain
http://faithfulcode.rubyforge.org

Scenarios

Scenarios

Scenarios

Scenarios

Scenarios

Scenarios

Scenarios

Scenarios

rcov

Did I test that or not?

heckle

Hurt your code for fun and profit

Fin