[rspec-users] Please clarify test / step definition return value?

James Byrne lists at ruby-forum.com
Wed Jan 14 14:44:25 EST 2009


I have been working under the impression that that tests/step
definitions worked on a simple boolean logic and behaved like ruby
methods, the last value is returned.  Thus, in my understanding, if the
return value is true then the step definition passed.  if it was false,
then the step definition failed.

However, in trying to determine why a simple boolean value returned from
the database did not seem to influence the test result I discovered
this:

# This always passes!!!
When /any matcher you want/ do
  false
end

# This, on the other hand, always fails.
When /any matcher you want/ do
  fail
end.

Was I truly fundamentally wrong in my previous belief that test results
are boolean true and false values?  If so, where exactly is this laid
out in the API because I missed it entirely.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list