I just updated the RSpec gem today since seeing from The RSpec book update that there is a new release.
1rl@bloodandguts:~/project$ ./script/spec_server 2Loading Rails environment 3 4***************************************************************** 5DEPRECATION WARNING: you are using deprecated behaviour that will 6be removed from a future version of RSpec. 7 8/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 9 10* spec_server is deprecated. 11* please use spork (gem install spork) instead. 12*****************************************************************
So…here we go.
Update the spec helper with the bootstrap command
The spec_helper will have instructions on how to edit the file although I mostly took the previous contents of the file and placed it in the ‘Spork.prefork’ block.
1require 'rubygems' 2require 'spork' 3 4Spork.prefork do 5 # Loading more in this block will cause your tests to run faster. However, 6 # if you change any configuration or code from libraries loaded here, you'll 7 # need to restart spork for it take effect. 8end 9 10Spork.each_run do 11 # This code will be run each time you run your specs. 12 13end 14 15# --- Instructions --- 16# - Sort through your spec_helper file. Place as much environment loading 17# code that you don't normally modify during development in the 18# Spork.prefork block. 19# - Place the rest under Spork.each_run block 20# - Any code that is left outside of the blocks will be ran during preforking 21# and during each_run! 22# - These instructions should self-destruct in 10 seconds. If they don't, 23# feel free to delete them. 24# 25 26# This file is copied to ~/spec when you run 'ruby script/generate rspec' 27# from the project root directory.
Starting the server with just ‘spork’
And run your spec for good measure.