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 web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot
Posted by Henning Koch to makandra dev (2010-10-22 19:46)