Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-08 Thread David Chelimsky
On 8/8/07, Eivind Uggedal [EMAIL PROTECTED] wrote: Here you go: http://pastie.caboo.se/85876 OK - that helped. The and_raise method can take an exception class or object. If you pass it the class, it will try to create an instance of it using Klass.new. This is the source of the problem. In

Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-08 Thread Eivind Uggedal
Thanks, that worked great after I had mocked out the ActiveRecord::Errors::full_messages: http://pastie.caboo.se/85887 Cheers, Eivind Uggedal On 8/8/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/8/07, Eivind Uggedal [EMAIL PROTECTED] wrote: Here you go: http://pastie.caboo.se/85876 OK

[rspec-users] Problems with raising errors on a mocked object

2007-08-07 Thread Eivind Uggedal
I'm trying to mock a object to raise a certain error. By doing so I get a ArgumentError on ActiveRecord's save! method: http://pastie.caboo.se/85628 I've tried to debug it but just can't seem to find what I'm doing wrong. Any help is greatly appreciated. Cheers, Eivind Uggedal

Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-07 Thread David Chelimsky
On 8/7/07, Eivind Uggedal [EMAIL PROTECTED] wrote: I'm trying to mock a object to raise a certain error. By doing so I get a ArgumentError on ActiveRecord's save! method: http://pastie.caboo.se/85628 I've tried to debug it but just can't seem to find what I'm doing wrong. Any help is

Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-07 Thread Eivind Uggedal
Here you go: http://pastie.caboo.se/85876 Eivind On 8/8/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/7/07, Eivind Uggedal [EMAIL PROTECTED] wrote: I'm trying to mock a object to raise a certain error. By doing so I get a ArgumentError on ActiveRecord's save! method: