Posted By: David Chelimsky
Date: 2006-11-06 03:03
Summary: rspec 0.7.0 released
Project: RSpec
This is the "Grow up and eat your own dog food release". RSpec is now used on itself and we're no longer using Test::Unit to test it. Although, we are still extending Test::Unit for the rails plugin (indirectly - through ZenTest)
IMPORTANT NOTE: THIS RELEASE IS NOT 100% BACKWARDS COMPATIBLE TO 0.6.x
There are a few changes that will require that you change your existing specs.
-------------------------------------------------- RSpec now handles equality exactly like ruby does:
# actual.should_equal(expected) will pass if actual.equal?(expected) returns true # actual.should_eql(expected) will pass if actual.eql?(expected) returns true # actual.should == expected will pass if actual == expected) returns true
At the high level, eql? implies equivalence, while equal? implies object identity. For more information on how ruby deals w/ equality, you should do this:
ri equal?
or look at this:
http://www.ruby-doc.org/core/classes/Object.html#M001057
Also, we left in should_be as a synonym for should_equal, so the only specs that should break are the ones using should_equal (which used to use <code>==</code> instead of <code>.equal?</code>).
Lastly, should_be used to handle true and false differently from any other values. We've removed this special handling, so now actual.should_be true will fail for any value other than true (it used to pass for any non-nil, non-false value), and actual.should_be false will fail for any value other than false (it used to pass for nil or false).
Here's what you'll need to do to update your specs:
|
|