[rspec-users] mocking errors

s.ross cwdinfo at gmail.com
Sun Jun 24 19:52:36 EDT 2007


I think having the errors collection not block specs from working  
initially should be a part of mock_model. Many, if not most, views  
rely on that collection's existence, so it could be considered a  
common case. Is this a candidate for including in mock_model by  
default, allowing the user to override to test certain error or  
success cases?

Steve

On Jun 24, 2007, at 4:48 PM, Moses Hohman wrote:

>
>
> On 6/24/07, David Smalley <david.smalley.lists at googlemail.com> wrote:
>
>> SImplest case:
>>
>> @mock_thing = mock_model(Thing, :errors => mock_model 
>> (Errors, :full_messages => ["An error"]))
>
> I left out something, that should actually be:
>
> @mock_thing = mock_model(Thing, :errors => mock_model 
> (ActiveRecord::Errors, :full_messages => ["An error"]))
>
> Moses
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Steve Ross
sross at calicowebdev.com
http://www.calicowebdev.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070624/07293f68/attachment.html 


More information about the rspec-users mailing list