Learn to unit test from scratch in Ruby

Are there any books or articles that teach you how to write a unit test in ruby?

+3


source to share


5 answers


The Rails guide for testing is pretty good: http://guides.rubyonrails.org/testing.html



+4


source


Assuming you want to write tests using "test / unit", the WikiBooks has an article about this http://en.wikibooks.org/wiki/Ruby_Programming/Unit_testing . But there are more test views for Ruby like RSpec and then take a look at http://rspec.info/ .



+2


source


If you want a book for Ruby, http://majesticseacreature.com/rbp-book/pdfs/rbp_1-0.pdf is a good source of information on Ruby written by Matz himself. It covers every topic in TDD
The Rails documentation is obviously targeting things, mostly around Rails, I'd recommend reading about Ruby over Rails.

+2


source


Do you want to use test :: unit or rspec? For rspec, the best way to learn is the Rspec Book ( Specification )

+1


source


I can absolutely recommend investing in buying and reading the RSpec Book: Behavior Driven by RSpec, Cucumbers and Friends . Aside from all the technical whistles, it will introduce you to an approach to programming that ensures your code is easy to test, adheres to good design practices, and does what your client thinks he should do.

+1


source







All Articles