This is a bug fix release, restoring integration with with rcov.

full changelog

  • Bug fixes
    • Don’t extend nil when filters are nil
    • require 'rspec/autorun' when running rcov.

rspec-2.6.0.rc3 is released!

April 30th, 2011

UPDATE: there was a problem related to rubygems that made this release uninstallable, so it’s been yanked and rc4 has been released.

This release addresses issues that were raised in the rspec-core-2.6.0.rc2 release.

rspec-core-2.6.0.rc3

full changelog

Enhancements

  • Clean up messages for filters/tags.

rspec-mocks-2.6.0.rc3

full changelog

Bug fixes

  • Support multiple calls to any_instance in the same example (Sidu Ponnappa)

rspec-rails-2.6.0.rc3

full changelog

Enhancements

  • Update the controller spec generated by the rails scaffold generator:
    • Add documentation to the generated spec
    • Use any_instance to avoid stubbing finders
    • Use real objects instead of mock_model
  • Update capybara integration to work with capy 0.4 and 1.0.0.beta
  • Decorate paths passed to [append|prepend]_view_paths with empty templates unless rendering views. (Mark Turner)

rspec-2.6.0.rc2 is released!

April 18th, 2011

We’re releasing rspec-2.6.0.rc2 as a release candidate as there are some internal changes that we’d like to see put through their paces before doing a final release. Note that the changes I speak of are internal. There are no new deprecations in this release, nor any backward-incompatible changes.

There are, however, some new features that we’re really excited about. Please do check it out and please do report any issues to the appropriate github issue tracker:

rspec-core-2.6.0.rc2

full changelog

  • Enhancements

    • shared_context (Damian Nurzynski)
      • extend groups matching specific metadata with:
        • method definitions
        • subject declarations
        • let/let! declarations
        • etc (anything you can do in a group)
    • its([:key]) works for any subject with #[]. (Peter Jaros)
    • treat_symbols_as_metadata_keys_with_true_values (Myron Marston)
    • Print a deprecation warning when you configure RSpec after defining an example. All configuration should happen before any examples are defined. (Myron Marston)
    • Pass the exit status of a DRb run to the invoking process. This causes specs run via DRb to not just return true or false. (Ilkka Laukkanen)
    • Refactoring of ConfigurationOptions#parse_options (Rodrigo Rosenfeld Rosas)
    • Report excluded filters in runner output (tip from andyl)
  • Bug fixes

    • Don’t stumble over an exception without a message (Hans Hasselberg)
    • Remove non-ascii characters from comments that were choking rcov (Geoffrey Byers)
    • Fixed backtrace so it doesn’t include lines from before the autorun at_exit hook (Myron Marston)
    • Include RSpec::Matchers when first example group is defined, rather than just before running the examples. This works around an obscure bug in ruby 1.9 that can cause infinite recursion. (Myron Marston)
    • Don’t send example_group_[started|finished] to formatters for empty groups.
    • Get specs passing on jruby (Sidu Ponnappa)
    • Fix bug where mixing nested groups and outer-level examples gave unpredictable :line_number behavior (Artur Małecki)
    • Regexp.escape the argument to –example (tip from Elliot Winkler)
    • Correctly pass/fail pending block with message expectations

rspec-expectations-2.6.0.rc2

full changelog

  • Enhancments

    • change matcher accepts Regexps (Robert Davis)
    • better descriptions for have_xxx matchers (Magnus Bergmark)
  • Bug fixes

    • Removed non-ascii characters that were choking rcov (Geoffrey Byers)
    • change matcher dups arrays and hashes so their before/after states can be compared correctly.
    • Fix the order of inclusion of RSpec::Matchers in Test::Unit::TestCase and MiniTest::Unit::TestCase to prevent a SystemStackError (Myron Marston)

rspec-mocks-2.6.0.rc2

full changelog

  • Enhancements

    • Add support for any_instance.stub and any_instance.should_receive (Sidu Ponnappa and Andy Lindeman)
  • Bug fixes

    • fix bug in which multiple chains with shared messages ending in hashes failed to return the correct value

rspec-rails-2.6.0.rc2

full changelog

  • Enhancments

    • rails 3 shortcuts for routing specs (Joe Fiorini)
    • support nested resources in generators (Tim McEwan)
    • require ‘rspec/rails/mocks’ to use mock_model without requiring the whole rails framework
  • Bug fixes

    • fix typo in “rake spec:statsetup” (Curtis Schofield)
    • expose named routes in anonymous controller specs (Andy Lindeman)
    • error when generating namespaced scaffold resources (Andy Lindeman)

rspec-core-2.5.1 is released!

February 6th, 2011

rspec-core-2.5.1

full changelog

This release breaks compatibility with rspec/autotest/bundler integration, but does so in order to greatly simplify it.

With the release of rspec-core-2.5.1, if you want the generated autotest command to include bundle exec, require Autotest’s bundler plugin in a .autotest file in the project’s root directory or in your home directory:

require "autotest/bundler"

Now you can just type ‘autotest’ on the commmand line and it will work as you expect.

If you don’t want ‘bundle exec’, there is nothing you have to do.

rspec-2.5.0 is released!

February 6th, 2011

rspec-2.5 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 http://relishapp.com/rspec, so the 2.5 docs won’t be up for another day or two, so I’ll detail the noticable differences here.

Autotest/Bundler integration

UPDATE: the –skip-bundler option does not work, and is removed from rspec-core-2.5.1. See the post on the 2.5.1 release for more information.

–skip-bundler

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 rspec-2.5:

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 directory:

require 'autotest/bundler'

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

UPDATE: The implicit detection of Gemfile is removed from rspec-core-2.5.1. See the post on the 2.5.1 release for more information.

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 you:

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

Changelog

rspec-core-2.5.0

full changelog

  • 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 again (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 autotest’s bundler plugin instead)

rspec-expectations-2.5.0

full changelog

  • Enhancements

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

    • improved docs for raise_error matcher (James Almond)

rspec-mocks-2.5.0

full changelog

  • Bug fixes
    • message expectation counts now work in combination with a stub (Damian Nurzynski)
    • fix failure message when message received with incorrect args (Josep M. Bach)

rspec-rails-2.5.0

full changelog

  • Enhancements

    • use index_helper instead of table_name when generating specs (Reza Primardiansyah)
  • Bug fixes

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

rspec-2.4.0 is released!

January 2nd, 2011

Changes in rspec-core and rspec-rails are listed below. There are no changes to rspec-mocks and rspec-expectations for this release.

rspec-core-2.4.0 / 2011-01-02

full changelog

  • Enhancements

    • start the debugger on -d so the stack trace is visible when it stops (Clifford Heath)
    • apply hook filtering to examples as well as groups (Myron Marston)
    • support multiple formatters, each with their own output
    • show exception classes in failure messages unless they come from RSpec matchers or message expectations
    • before(:all) { pending } sets all examples to pending
  • Bug fixes

    • fix bug due to change in behavior of reject in Ruby 1.9.3-dev (Shota Fukumori)
    • fix bug when running in jruby: be explicit about passing block to super (John Firebaugh)
    • rake task doesn’t choke on paths with quotes (Janmejay Singh)
    • restore –options option from rspec-1
    • require ‘ostruct’ to fix bug with its([key]) (Kim Burgestrand)
    • –configure option generates .rspec file instead of autotest/discover.rb

rspec-rails-2.4.0 / 2011-01-02

full changelog

  • Enhancements

    • include ApplicationHelper in helper object in helper specs
    • include request spec extensions in files in spec/integration
    • include controller spec extensions in groups that use :type => :controller
    • same for :model, :view, :helper, :mailer, :request, :routing
  • Bug fixes

    • restore global config.render_views so you only need to say it once
    • support overriding render_views in nested groups
    • matchers that delegate to Rails’ assertions capture ActiveSupport::TestCase::Assertion (so they work properly now with should_not in Ruby 1.8.7 and 1.9.1)
  • Deprecations

    • include_self_when_dir_matches

rspec-core-2.3.1 is released!

December 16th, 2010

full changelog

  • Bug fixes
    • send debugger warning message to $stdout if RSpec.configuration.error_stream has not been defined yet.
    • HTML Formatter finally properly displays nested groups (Jarmo Pertman)
    • eliminate some warnings when running RSpec’s own suite (Jarmo Pertman)

rspec-2.3.0 is released!

December 12th, 2010

rspec-core-2.3.0 / 2010-12-12

full changelog

  • Enhancements

    • tell autotest to use “rspec2″ if it sees a .rspec file in the project’s root directory
      • replaces the need for ./autotest/discover.rb, which will not work with all versions of ZenTest and/or autotest
    • config.expect_with
      • :rspec # => rspec/expectations
      • :stdlib # => test/unit/assertions
      • :rspec, :stdlib # => both
  • Bug fixes

    • fix dev Gemfile to work on non-mac-os machines (Lake Denman)
    • ensure explicit subject is only eval’d once (Laszlo Bacsi)

rspec-expectations-2.3.0 / 2010-12-12

full changelog

  • Enhancements
    • diff strings when include matcher fails (Mike Sassak)

rspec-mocks-2.3.0 / 2010-12-12

full changelog

  • Bug fixes
    • Fix our Marshal extension so that it does not interfere with objects that have their own @mock_proxy instance variable. (Myron Marston)

rspec-rails-2.3.0 / 2010-12-12

full changelog

  • Changes
    • Generator no longer generates autotest/autodiscover.rb, as it is no longer needed (as of rspec-core-2.3.0)

rspec-rails-2.2.1 is released

December 1st, 2010

rspec-rails-2.2.1 / 2010-12-01

full changelog

  • Bug fixes

    • Depend on railties, activesupport, and actionpack instead of rails (Piotr Solnica)
    • Got webrat integration working properly across different types of specs
  • Deprecations

    • –webrat-matchers flag for generators is deprecated. use –webrat instead.

rspec-core-2.2.1 is released!

November 29th, 2010

2.2.1 / 2010-11-28

full changelog

  • Bug fixes
    • alias_method instead of override Kernel#method_missing (John Wilger)
    • changed –autotest to –tty in generated command (MIKAMI Yoshiyuki)
    • revert change to debugger (had introduced conflict with Rails)
    • also restored –debugger/-debug option