[Rspec-devel] Failure messages - customize per "should" assertion

itsme213 itsme213 at hotmail.com
Sat May 27 23:50:08 EDT 2006


Is there a way to customize the failure message for each "should" assertion?

e.g. I have

 specify 'every activity should have an output' do
  Activity.instances.each {|a| a.outputs.should_not_be_empty }
 end

I get:

1)
ExpectationNotMetError in 'MAp object graph every activity should have an 
output'
[] should not be empty


I would like to customize the failure message based on the activity |a|.

Is this possible? Should it be?

Thanks!


More information about the Rspec-devel mailing list