Rspec-2.5.0 is released!

RSpec-2.5.0 is released!

This is a minor upgrade, and is fully backward compatible with
rspec-2.4. It includes several bug fixes, enhancements, and one
deprecation. See the changelog below for details.

We had a little glitch publishing the docs to, so the 2.5
docs won’t be up for another day or two, so I’ll detail the noticable
differences here (and on

Autotest/Bundler integration


RSpec’s Autotest integration assumes that you want bundle exec in the
shell command generated by Autotest if you have a Gemfile. This works
fine for some situations, but not all, so we added an opt-out for

autotest -- --skip-bundler

Autotest ignores everything after the initial --, so RSpec’s Autotest
extension handles the --skip-bundler option.

Autotest’s bundler plugin

Autotest ships with a plugin for bundler. Just add the following to a
.autotest file in the project’s root directory, or your home

require 'autotest/bundler'

This prefixes the generated shell command with ‘bundle exec’.

Implicit detection of Gemfile is deprecated

Given that Autotest has its own way of dealing with Bundler (see above),
we deprecated the implicit assumption that Gemfile means “use
bundler”. You’ll see a deprecation notice if you are relying on that,
but it still works. It’s just a deprecation warning. To silence the
warning, either use the --skip-bundler option or Autotest’s bundler
plugin, described above.

HTML Formatter

The HTML formatter now has a set of checkboxes in the header that allow
you to filter what you’re looking at:

to not, or not to not

Are you the sort of person for whom “expect this block of code to not
raise an error” is like nails on chalkboard? If so, relief has arrived.
You may now type either of the following, and RSpec will happily service

expect { ... }.to_not raise_error
expect { ... }.not_to raise_error




  • Enhancements

    • Autotest::Rspec2 parses command line args passed to autotest after
    • –skip-bundler option for autotest command
    • Autotest regexp fixes (Jon Rowe)
    • Add filters to html and textmate formatters (Daniel Quimper)
    • Explicit passing of block (need for JRuby 1.6) (John Firebaugh)
  • Bug fixes

    • fix dom IDs in HTML formatter (Brian Faherty)
    • fix bug with --drb + formatters when not running in drb
    • include --tag options in drb args (monocle)
    • fix regression so now SPEC_OPTS take precedence over CLI options
      (Roman Chernyatchik)
    • only call its(:attribute) once (failing example from Brian Dunn)
    • fix bizarre bug where rspec would hang after String.alias :to_int :to_i
      (Damian Nurzynski)
  • Deprecations

    • implicit inclusion of ‘bundle exec’ when Gemfile present (use
      bundler plugin instead)



  • Enhancements

    • should exist works with exist? or exists? (Myron M.)
    • expect { ... }.not_to do_something (in addition to to_not)
  • Documentation

    • improved docs for raise_error matcher (James Almond)



  • Bug fixes
    • message expectation counts now work in combination with a stub
    • fix failure message when message received with incorrect args (Josep



  • Enhancements

    • use index_helper instead of table_name when generating specs
  • Bug fixes

    • fixed bug in which render_views in a nested group set the value in
      parent group.
    • only include MailerExampleGroup when it is defiend (Steve S.)
    • mock_model.as_null_object.attribute.blank? returns false (Randy
    • fix typo in request specs (Paco G.)