Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the Difference between the Rspec and Rspec-Rails Gem?

I have the following in my GEMFILE:

group :development do 
  gem 'rspec-rails'
  gem 'annotate-models'
end 

group :test do 
  gem 'rspec'
  gem 'webrat'
  gem 'spork'
  gem 'factory_girl_rails'
end 

What's the difference between 'rspec' and 'rspec-rails'?

like image 966
kev Avatar asked Apr 14 '11 03:04

kev


People also ask

What is RSpec rails gem?

rspec-rails is a testing framework for Rails 3. x and 4.

Is RSpec a gem?

Description. rspec is a meta-gem, which depends on the rspec-core, rspec-expectations and rspec-mocks gems. Each of these can be installed separately and loaded in isolation using require .

How do I use RSpec gems?

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. That's it.

What is the difference between RSpec and cucumber?

The main difference between RSpec and Cucumber are the business readability factor. Cucumber's main draw is that the specification (features) are separate from the test code, so your product owners can provide or review the specification without having to dig through code.


1 Answers

As stated on their wiki page:

rspec-rails extends RSpec and Ruby on Rails so you can specify the behaviour of your rails web-app.

https://github.com/dchelimsky/rspec/wiki/rails

Whereas the rspec gem has no support for rails, providing a testing framework for plain old ruby applications.

like image 102
Mike Lewis Avatar answered Sep 22 '22 02:09

Mike Lewis