Read more

Migrating to RSpec 2 from RSpec 1

Henning Koch
October 22, 2010Software engineer at makandra GmbH

You will need to upgrade to RSpec >= 2 and rspec-rails >= 2 for Rails 3. Here are some hints to get started:

  • In RSpec 2 the executable is rspec, not spec.
  • RSpec and rspec-rails have been completely refactored internally. All RSpec classes have been renamed from Spec::Something to RSpec::Something. This also means that every require 'spec/something' must now be require 'rspec/something'.
  • In spec_helper.rb, Spec::Runner.configure becomes RSpec.configure
  • It has become really hard to extend specific example groups in rspec-rails (e.g. only controller example groups). Your existing example macros will probably break for this reason. Save yourself the trouble and attach all your macros to RSpec::Core::ExampleGroup instead.
  • Your spec_candy.rb will break. We have a working update in the repository "why", branch "rails3". We will update the note soon.
  • rspec_spinner does not yet work with RSpec 2. We will update the gem soon.
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot
Posted by Henning Koch to makandra dev (2010-10-22 19:46)