[rspec-users] New bie question: Why use assert_equal when there are comparison operators in Rspec?
ashley.moran at patchspace.co.uk
Fri Aug 6 05:32:55 EDT 2010
On Aug 06, 2010, at 3:52 am, ct9a wrote:
> Reading up on the Rspec's main site, the main example in
> http://rspec.rubyforge.org/rspec/1.3.0/ does not show any use of
> assert_equals. Rather it just uses the "==" comparison operators.
> Here's an extract:
assert_equals is part of Test::Unit, not RSpec. You can't use assert_equals in RSpec unless you also have Test::Unit loaded. The default Rails test suite setup is based on Test::Unit, so you have access to both. (RSpec it designed to integrate with it.) There's no reason to use assert_equals unless you want to, and personally I'd avoid miking the two styles.
More information about the rspec-users