Re: [rspec-users] and_raise with a message

2012-08-22 Thread Bas Vodde
Hola, I went ahead and wrote some code instead of emails and implemented it and send a pull request. The way I implemented was just pretty simple: - and_raise has a second parameter which is an empty string by default - when raise_exception is called and the exception passed is a Class, then i

Re: [rspec-users] and_raise with a message

2012-08-22 Thread David Chelimsky
On Wed, Aug 22, 2012 at 6:55 AM, David Chelimsky wrote: > On Wed, Aug 22, 2012 at 6:43 AM, Bas Vodde wrote: >> >> On 22 Aug, 2012, at 7:25 PM, David Chelimsky wrote: >> >>> On Wed, Aug 22, 2012 at 12:56 AM, Bas Vodde wrote: Hiya all, I was trying to get and_raise to raise an

Re: [rspec-users] and_raise with a message

2012-08-22 Thread David Chelimsky
On Wed, Aug 22, 2012 at 6:43 AM, Bas Vodde wrote: > > On 22 Aug, 2012, at 7:25 PM, David Chelimsky wrote: > >> On Wed, Aug 22, 2012 at 12:56 AM, Bas Vodde wrote: >>> >>> Hiya all, >>> >>> I was trying to get and_raise to raise an exception filled with a message >>> and I was struggling with the

Re: [rspec-users] and_raise with a message

2012-08-22 Thread Bas Vodde
Hi David, My main thinking was to make it consistent with the Kernel.raise. Like, in my production code, I have: raise Osaka::SystemCommandFailed, output_message so, it would make sense to the mock to work the same with: and_raise Osaka::SystemCommandFailed, "Fake output message" I figured i

Re: [rspec-users] and_raise with a message

2012-08-22 Thread David Chelimsky
On Wed, Aug 22, 2012 at 12:56 AM, Bas Vodde wrote: > > Hiya all, > > I was trying to get and_raise to raise an exception filled with a message and > I was struggling with the API for a while (not on the latest RSpec, but > assume it didn't change). > > Based on that, I have a suggestion for impr

[rspec-users] and_raise with a message

2012-08-21 Thread Bas Vodde
Hiya all, I was trying to get and_raise to raise an exception filled with a message and I was struggling with the API for a while (not on the latest RSpec, but assume it didn't change). Based on that, I have a suggestion for improvement. My first attempt was to mirror how I use raise, so I tr