[rspec-users] slightly confusing error message

David Chelimsky dchelimsky at gmail.com
Tue Aug 23 17:18:48 EDT 2011


On Aug 23, 2011, at 3:26 PM, Rob Biedenharn wrote:

> On Aug 23, 2011, at 3:16 PM, David Chelimsky wrote:
> 
>> On Aug 23, 2011, at 1:00 PM, Roger Pack wrote:
>> 
>>> This error message:
>>> 
>>> 
>>> it 'should' do
>>>    proc { eval("a=")}.should raise_exception(/SyntaxError/)
>>> end
> 
> shouldn't that be
> 	raise_exception(SyntaxError)
> that is, the exception class, not a Regexp literal to match its name.

It supports any of:

raise_error(ErrorClass)
raise_error(ErrorClass, string)
raise_error(ErrorClass, /regex/)
raise_error(string)
raise_error(/regex/)

(or raise_exception with the same set of alternatives)

Cheers,
David


> 
>>> 
>>> 
>>>     expected Exception with message matching /SyntaxError/, got
>>> #<SyntaxError: (eval):1: syntax error, unexpected end-of-file>
>>> 
>>> Is a bit confusing, since it appears from the error output that it
>>> *does* match /SyntaxError/
>>> 
>>> Might be able to word it better or along those lines.
>>> Thanks!
>>> -roger-
>> 
>> Please report this to http://github.com/rspec/rspec-expectations/issues.
>> 
>> Cheers,
>> David
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
> 
> Rob Biedenharn		
> Rob at AgileConsultingLLC.com	http://AgileConsultingLLC.com/
> rab at GaslightSoftware.com		http://GaslightSoftware.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