This document discusses using the RSpec testing framework for test-driven development. It provides an example RSpec test describing a class and array, explaining how the tests ensure the array is not nil and its last element is 'C'. The document also references resources on test-driven development, refactoring, and the bowling game kata coding exercise.
1 of 98
Downloaded 157 times
More Related Content
S is for Spec
1. “S is for Spec”:Test Driven Development w/ RSpec
KAKUTANI Shintaro; Eiwa System Management,Inc.; Nihon Ruby-no-kai
74. describe Array, quot;with some entriesquot; do
before(:each) do
@array = %w(A B C)
end
it quot;should not be nilquot; do
@array.should_not be_nil
end
it quot;should last element is 'C'quot; do
@array.last.should == 'C'
end
end
82. The Bowling Game Kata
by Robert C.Martin(Uncle Bob)
Bowling Game Kata
Object Mentor, Inc.
www.objectmentor.com
blog.objectmentor.com
fitnesse.org www.junit.org
Copyright 2005 by Object Mentor, Inc
All copies must retain this page unchanged.
http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata