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-2.2 is released!

November 28th, 2010

rspec-core-2.2.0

full changelog

  • Deprecations/changes

    • –debug/-d on command line is deprecated and now has no effect
    • win32console is now ignored; Windows users must use ANSICON for color support (Bosko Ivanisevic)
  • Enhancements

    • Raise exception with helpful message when rspec-1 is loaded alongside rspec-2 (Justin Ko)
    • debugger statements just work as long as ruby-debug is installed
    • otherwise you get warned, but not fired
    • Expose example.metadata in around hooks
    • Performance improvments (see Upgrade.markdown)
  • Bug fixes

    • Make sure –fail-fast makes it across drb
    • Pass -Ilib:spec to rcov

rspec-mocks-2.2.0

full changelog

  • Enhancements

    • Added “rspec/mocks/standalone” for exploring the rspec-mocks in irb.
  • Bug fix

    • Eliminate warning on splat args without parens (Gioele Barabucci)
    • Fix bug where obj.should_receive(:foo).with(stub.as_null_object) would
      pass with a false positive.

rspec-rails-2.2.0

full changelog

  • Enhancements

    • Added stub_template in view specs
  • Bug fixes

    • Properly include helpers in views (Jonathan del Strother)
    • Fix bug in which method missing led to a stack overflow
    • Fix stack overflow in request specs with open_session
    • Fix stack overflow in any spec when method_missing was invoked
    • Add gem dependency on rails ~> 3.0.0 (ensures bundler won’t install rspec-rails-2 with rails-2 apps).

rspec-2.1 is released

November 7th, 2010

rspec-core-2.1.0 / 2010-11-07

Cucumber features
RDoc # will be generated by 2010-11-08
full changelog

  • Enhancments

    • Add skip_bundler option to rake task to tell rake task to ignore the presence of a Gemfile (jfelchner)
    • Add gemfile option to rake task to tell rake task what Gemfile to look for (defaults to ‘Gemfile’)
    • Allow passing caller trace into Metadata to support extensions (Glenn Vanderburg)
    • Add deprecation warning for Spec::Runner.configure to aid upgrade from RSpec-1
    • Add deprecated Spec::Rake::SpecTask to aid upgrade from RSpec-1
    • Add ‘autospec’ command with helpful message to aid upgrade from RSpec-1
    • Add support for filtering with tags on CLI (Lailson Bandeira)
    • Add a helpful message about RUBYOPT when require fails in bin/rspec (slyphon)
    • Add “-Ilib” to the default rcov options (Tianyi Cui)
    • Make the expectation framework configurable (default rspec, of course) (Justin Ko)
    • Add ‘pending’ to be conditional (Myron Marston)
    • Add explicit support for :if and :unless as metadata keys for conditional run of examples (Myron Marston)
    • Add –fail-fast command line option (Jeff Kreeftmeijer)
  • Bug fixes

    • Eliminate stack overflow with “subject { self }”
    • Require ‘rspec/core’ in the Raketask (ensures it required when running rcov)

rspec-expectations-2.1.0 / 2010-11-07

Cucumber features
RDoc # will be generated by 2010-11-08
full changelog

  • Enhancements

    • be_within(delta).of(expected) matcher (Myron Marston)
    • Lots of new Cucumber features (Myron Marston)
    • Raise error if you try “should != expected” on Ruby-1.9 (Myron Marston)
    • Improved failure messages from throw_symbol (Myron Marston)
  • Bug fixes

    • Eliminate hard dependency on RSpec::Core (Myron Marston)
    • have_matcher - use pluralize only when ActiveSupport inflections are indeed defined (Josep M Bach)
    • throw_symbol matcher no longer swallows exceptions (Myron Marston)
    • fix matcher chaining to avoid name collisions (Myron Marston)

rspec-mocks-2.1.0 / 2010-11-07

Cucumber features
RDoc # will be generated by 2010-11-08
full changelog

  • Bug fixes
    • Fix serialization of stubbed object (Josep M Bach)

rspec-rails-2.1.0 / 2010-11-07

Cucumber features
RDoc # will be generated by 2010-11-08
full changelog

  • Enhancements

    • Move errors_on to ActiveModel to support other AM-compliant ORMs
  • Bug fixes

    • Check for presence of ActiveRecord instead of checking Rails config (gets rspec out of the way of multiple ORMs in the same app)

rspec-rails-2.0.1 is released!

October 15th, 2010

The rails-3.0.1 release excluded a change that I had naively expected to be included. This upgrade is only necessary if you write view specs and are upgrading to rails-3.0.1. To upgrade, all you need to do is change your Gemfile to read:

gem "rspec-rails", "2.0.1"

And then run

bundle update rspec-rails

Release Notes

2.0.1 / 2010-10-15

full changelog

  • Enhancements

    • Add option to not generate request spec (–skip-request-specs)
  • Bug fixes

    • Updated the mock_[model] method generated in controller specs so it adds any stubs submitted each time it is called.
    • Fixed bug where view assigns weren’t making it to the view in view specs in Rails-3.0.1. (Emanuele Vicentini)

RSpec-2.0.0 is released!

October 10th, 2010

This marks the end of a year-long effort that improves RSpec in a number of ways, including modularity, cleaner code, and much better integration with Rails-3 than was possible before.

Docs, with a little bit of relish

In addition to the documentation available at all the places mentioned my earlier post, we’ve also got all of the Cucumber features posted to Justin Ko’s new Cucumber presentation app, relish.

http://relishapp.com/rspec

We’ll also have the RDoc up on http://rdoc.info in a day or so.

Thanks!

Big thanks to 80+ contributors who submitted patches for RSpec-2.0.0, including [1]:

Aan, Adam Walters, Akira Matsuda, Alex Crichton, Anderson Dias, Andre Arko, Andreas Neuhaus, Ashley Moran, Ben Armston, Ben Rady, Brasten Sager, Brian J Reath, Carlhuda, Chad Humphries, Charles Lowell, Chris Redinger, Chuck Remes, Corey Ehmke, Corey Haines, Dan Peterson, Dave Newman, David Genord II, David S. Kang, Ethan Gunderson, Gonçalo Silva, Greg Sterndale, Hans de Graaff, Iain Hecker, Jacques Crocker, Jean-Daniel Guyot, Jeff Ramnani, Jim Breen, Johan Kiviniemi, Josep Mª Bach, Josh Graham, Joshua Nichols, Kabari Hendrick, Kristian M, Lailson B, Len Smith, Leonardo Bessa, Les Hill, Luis Lavena, Marcin Kulik, Markus Schirp, Matt Remsik, Matt Yoho, Matthew Todd, Michael Niessner, Mike Gehard, Myron Marston, Nate Jackson, Neeraj Singh, Nestor Ovroy, Nick Ang, Nicolas Braem, Paul Rosania, Phil Smith, Postmodern, Prasad, Rob Sanheim, Roman Chernyatchik, Ryan Bigg, Ryan Briones, Sam Pohlenz, Scott Taylor, Shin-ichiro OGAWA, Thibaud Guillaume-Gentil, Tim Connor, Tim Harper, Tom Stuart, Vít Ondruch, Wincent Colaiuta, aslakhellesoy, eira, garren smith, grosser, hasimo, justinko, rup, speedmax, wycats

Extra special thanks go to:

  • Chad Humphries for contributing his Micronaut gem which is the basis for rspec-core-2
  • Yehuda Katz, Carl Lerche, and José Valim, for their assistance with getting rspec-rails-2 to take advantage of new APIs in Rails-3, and for shepherding patches to Rails that made it far simpler for testing extensions like rspec-rails to hook into Rails’ testing infrastructure. Their work here has significantly reduced the risk that Rails point-releases will break rspec-rails.
  • Myron Marston for a wealth of thoughtful contributions including Cucumber features that we can all learn from
  • Justin Ko for his direct contributions to rspec, and for relish, which makes executable documentation act more like documentation.

What’s next?

rspec-rails-2 for rails-2

There are a couple of projects floating around that support rspec-2 and rails-2. I haven’t had the chance to review any of these myself, but my hope is that we’ll have be an official rspec-2 for rails-2 gem in the coming months.

rspec-1 maintenance

rspec-1 will continue to get maintenance releases, but these will be restricted, primarily, to bug fixes. Any new features will go into rspec-2, and will likely not be back-ported.

[1] Contributor names were generated from the git commit logs.

RSpec-2.0.0.beta.22 is released!

September 12th, 2010

We’re getting very close to a 2.0 release candidate, so if you’re not already using rspec-2 (with or without rails-3), now is the time to start. I need your feedback, so from here on in I’ll be sending out announcements and release notes for each beta release.

As for rspec-2 with rails-2, there are a few efforts underway to make that work, but that will be in the form of a separate gem and our priority is getting rspec-2 out the door.

Please report issues or submit pull requests (yes, pull requests are fine now that github has integrated them so well with issues) to the appropriate repos:

Here are release notes for each gem in this beta release, drawn from the nascent History.md files in each project.

rspec-core-2.0.0.beta.22 / 2010-09-12

full changelog

  • Enhancements

    • removed at_exit hook
    • CTRL-C stops the run (almost) immediately
    • first it cleans things up by running the appropriate after(:all) and after(:suite) hooks
    • then it reports on any examples that have already run
    • cleaned up rake task
    • generate correct task under variety of conditions
    • options are more consistent
    • deprecated redundant options
    • run ‘bundle exec autotest’ when Gemfile is present
    • support ERB in .rspec options files (Justin Ko)
    • depend on bundler for development tasks (Myron Marston)
    • add example_group_finished to formatters and reporter (Roman Chernyatchik)
  • Bug fixes

    • support paths with spaces when using autotest (Andreas Neuhaus)
    • fix module_exec with ruby 1.8.6 (Myron Marston)
    • remove context method from top-level
    • was conflicting with irb, for example
    • errors in before(:all) are now reported correctly (Chad Humphries)
  • Removals

    • removed -o –options-file command line option
    • use ./.rspec and ~/.rspec

rspec-expectations-2.0.0.beta.22 / 2010-09-12

full changelog

  • Enhancements

    • diffing improvements
    • diff multiline strings
    • don’t diff single line strings
    • don’t diff numbers (silly)
    • diff regexp + multiline string
  • Bug fixes

    • should[_not] change now handles boolean values correctly

rspec-mocks-2.0.0.beta.22 / 2010-09-12

full changelog

  • Bug fixes
    • fixed regression that broke obj.stub_chain(:a, :b => :c)
    • fixed regression that broke obj.stub_chain(:a, :b) { :c }
    • respond_to? always returns true when using as_null_object

2.0.0.beta.22 / 2010-09-12

full changelog

  • Enhancements

    • autotest mapping improvements (Andreas Neuhaus)
  • Bug fixes

    • delegate flunk to assertion delegate

I’m thrilled to announce that The RSpec Book has entered the production process!

For those of you unfamiliar with the publishing industry, as I was before this project, “has entered the production process” does not mean that it’s off to the printer. What it does mean is that it is currently being indexed so readers will be able to find the stuff they’re looking for. After indexing it will be copyedited (in which someone with better grammar and spelling than any of the authors possess makes the book more readable) and typeset, and then off to the printer.

If all goes to plan (yes, there actually is a plan!), books.should be_on_shelves in late September, early October.

That light at the end of the tunnel is, finally, not an oncoming train!

As of rspec-rails-2.0.0.beta.17, generators and rake tasks are exposed through a Railtie. In order to see them when you run rails generate and rake -T, you need to include the rspec-rails gem in the :development group in your Gemfile.

group :development, :test do
  gem "rspec-rails", ">= 2.0.0.beta.17"
end

If you have a previous version of rspec-rails-2.0.0.beta installed, you should also remove these files:

lib/tasks/rspec.rake
config/initializers/rspec_generator.rb

Rspec 2 and Rails 3

January 12th, 2010

With the beta release of Rails 3 just around the corner, we’re planning a 2.0 release of Rspec, with an rspec-rails-2.0 gem for rails-3.0.

Late last week and through the weekend, Engine Yard, Relevance and Obtiva sponsored a meeting with Yehuda Katz, Carl Lerche, Chad Humphries, and me. The four of us laid out some groundwork and made some good progress toward what promises to be be a very friendly world for Rspec and Rails users and extenders.

Thanks to David Heinemeier Hansson and the rest of the Rails core team for embracing agnosticism without compromising convention over configuration.

I’ll follow up with details as things shape up, but here is a quick synopsis:

Rails users

Whether or not you use Rspec, you’ll see improvements in some of the built-in assertions, and other testing facilities that ship with Rails.

Rspec-rails users

If you do use Rspec, you’ll see a new rspec-rails plugin/gem that hooks into new features of rails-3 like the new rails generators. You’ll also see support for Merb-style request specs that wrap Rails’ integration tests.

Test framework authors

Rails’ testing APIs will be decoupled from the Test::Unit and Minitest runners. For authors of new testing frameworks, this means that you’ll be able to include a module in your framework’s objects instead of having to subclass TestCase. This will make it much easier to experiment with new ideas in the context of Rails, which clearly exposes those ideas to a wider audience than otherwise.

release candidates

We’re using the new rubygems prerelease feature to do proper release candidates. This feature was introduced to rubygems a couple of versions back, but I’d recommend updating to rubygems-1.3.5 before installing the rspec prerelease gems.

For those unfamiliar with this new rubygems feature, you have to add the --prerelease flag in order to see and install these gems:

$ gem search --remote --prerelease rspec

  *** REMOTE GEMS ***

  rspec (1.2.9.rc1)
  rspec-rails (1.2.9.rc1)

$ [sudo] gem install --prerelease rspec
$ [sudo] gem install --prerelease rspec-rails

This way only those who choose to install the prerelease gems will get them, while those who exclude the –prerelease flag will get the previous final release (rspec-1.2.8, rspec-rails-1.2.7.1).

Once you install the prerelease gems, Rubygems will treat 1.2.9.rc1 as a higher version than 1.2.8, but a lower version than 1.2.9. That way when we do the final release you’ll be able to just install 1.2.9 and it will take its rightful place ahead of 1.2.9.rc1 without you having to uninstall rc1.

I invite you to install these prerelease gems and report any issues you run into to http://rspec.lighthouseapp.com/rspec. Advanced thanks to those who help the rest by breaking these in.

changes

Here are the changelogs for both rspec and rspec-rails. I’ll post separately about some of the new features in more detail.

rspec-1.2.9-rc1

  • enhancements

    • manage backtrace-ignore patterns with Spec::Runner.configure (Martin Emde). Closes #870.
    • friendly mock argument expectation failure message (Tim Harper). Closes #868.
    • added double() as alias for stub() and mock()
    • failure messages for doubles, mocks and stubs use the right name
    • add let() method to assign memoized attributes (suggestion from Stuart Halloway). Closes #857.
    • add its method so you can say: describe Array do its(:length) { should == 0 } (Stephen Touset). Closes #833
    • spec command automatically uses spec/spec.opts if it is present (suggestion from Yehuda Katz)
    • rspec now adds PROJECT_ROOT/lib and PROJECT_ROOT/spec to the load path
    • determines PROJECT_ROOT by recursing up until it finds a directory that has a ./spec directory (thanks to Scott Taylor)
    • supports require ’spec_helper’
    • supports running specs from the PROJECT_ROOT or any directory below it
    • closes #733
  • not really a bug fix or enhancement

    • temporarily moved heckle feature to features-pending (waiting to see what happens with http://rubyforge.org/tracker/index.php?func=detail&aid=26786&group_id=1513&atid=5921)

rspec-rails-1.2.9-rc1

  • enhancements

    • added route_to and be_routable matchers (Randy Harmon). Closes #843.
    • Provide better failure message for render_template when redirected (Josh Nichols). Closes #885.
    • generated specs require ’spec_helper’
  • bug fixes

    • pass the correct args to super in controller#render depending on the rails version (Lucas Carlson). Closes #865.
    • use Rack::Utils.parse_query to convert query strings to hashes. Closes #872.
    • errors correctly bubble up when a controller spec in isolation mode requests a non-existent action/template
    • no error if either action or template exist
    • error if neither exist
    • Closes #888.
  • removals

    • spec_server has been removed in favor of spork.
    • You can still use the –drb flag, but you’ve got to install the spork gem.
    • Windows users who cannot use the spork gem can install the spec_server from http://github.com/dchelimsky/spec_server
  • http://rspec.info

  • http://rubyforge.org/projects/rspec
  • http://github.com/dchelimsky/rspec
  • http://github.com/dchelimsky/rspec-rails
  • http://wiki.github.com/dchelimsky/rspec
  • rspec-users@rubyforge.org
  • rspec-devel@rubyforge.org