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

David Chelimsky dchelimsky at gmail.com
Wed Jan 14 15:50:49 EST 2009

On Wed, Jan 14, 2009 at 1:44 PM, James Byrne <lists at ruby-forum.com> wrote:
> 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.

Seems like you've answered your own question. I'm not sure where it's
laid out in the docs, but I'm also unsure as to where you got the
impression you had :)

Never-the-less - steps will remain quiet unless some error is raised.


> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list