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'?
rspec-rails is a testing framework for Rails 3. x and 4.
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 .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With