Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start with Rspec?

I have been into rails for the last 3 months. Now I wish to start BDD or TDD. I want to start with RSpec. How do I start with it?

like image 491
Arc Avatar asked Mar 29 '09 21:03

Arc


People also ask

How do I run RSpec?

Running tests by their file or directory names is the most familiar way to run tests with RSpec. RSpec can take a file name or directory name and run the file or the contents of the directory. So you can do: rspec spec/jobs to run the tests found in the jobs directory.

What is RSpec used for?

RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly.

How do I download RSpec?

Installing RSpec Boot up your terminal and punch in gem install rspec to install RSpec. Once that's done, you can verify your version of RSpec with rspec --version , which will output the current version of each of the packaged gems. Take a minute also to hit rspec --help and look through the various options available.


1 Answers

The following websites may be of interest:

  • http://peepcode.com/products/rspec-basics
  • http://www.elctech.com/tutorials/rspec-tutorial
  • http://jimmyzimmerman.com/blog/2007/11/simple-tutorials-for-learning-bdd-and-rspec.html
like image 177
Matthew Farwell Avatar answered Oct 09 '22 16:10

Matthew Farwell