CARVIEW |
Home
Rspec 2
Rspec 2 is now in beta. Here are a couple of hints to get started. Feel free to beef this up or add to this wiki.
install
gem install rspec --pre
This will install four gems:
rspec (depends on the other three gems)
rspec-core
rspec-expectations
rspec-mocks
It also installs a new rspec
command (which will replace the spec
command from rspec-1), an updated spec
command that tries to help rspec-1 and rspec-2 play nice together. As of now there is no autospec
command for rspec-2, and there is no plan to add one. Instead, we’ll offer a means of generating the necessary configuration code for autotest
to work with rspec (more on that as details emerge).
NOTE that you will need to run the autospec command as follows if you’ve got both rspec-1.3.0 and rspec-2.x installed on your system:
autospec _1.3.0_
spec/spec_helper.rb
require 'rspec'
# optionally add autorun support
require 'rspec/autorun'
Rspec.configure do |c|
c.mock_with :rspec
end