Re: [rspec-users] Re-using Rspec Matchers

2010-09-08 Thread Ben Mabey
On 9/8/10 11:42 AM, Brian Kaney wrote: Hey Everyone, Is it good practice to call matchers from within matchers? Kinda like this pattern: See: http://gist.github.com/570467 No, that should be avoided. The problem is that the "internal" matcher will throw an exception that will bubble u

Re: [rspec-users] Re-using Rspec Matchers

2010-09-08 Thread David Chelimsky
On Sep 8, 2010, at 5:19 PM, Brian Kaney wrote: > On Sep 8, 2010, at 2:17 PM, "J. B. Rainsberger" wrote: > >> On Wed, Sep 8, 2010 at 14:42, Brian Kaney wrote: >> >>> Is it good practice to call matchers from within matchers? Kinda like >>> this pattern: >>> >>> See: http://gist.github.com/

Re: [rspec-users] Re-using Rspec Matchers

2010-09-08 Thread Brian Kaney
On Sep 8, 2010, at 2:17 PM, "J. B. Rainsberger" wrote: > On Wed, Sep 8, 2010 at 14:42, Brian Kaney wrote: > >> Is it good practice to call matchers from within matchers? Kinda like this >> pattern: >> >> See: http://gist.github.com/570467 > > David Chelimsky taught me not to invoke #shoul

Re: [rspec-users] Re-using Rspec Matchers

2010-09-08 Thread J. B. Rainsberger
On Wed, Sep 8, 2010 at 14:42, Brian Kaney wrote: > Is it good practice to call matchers from within matchers?   Kinda like this > pattern: > >  See: http://gist.github.com/570467 David Chelimsky taught me not to invoke #should in a matcher, but rather just answer a boolean, so I expect that, ra

[rspec-users] Re-using Rspec Matchers

2010-09-08 Thread Brian Kaney
Hey Everyone, Is it good practice to call matchers from within matchers? Kinda like this pattern: See: http://gist.github.com/570467 -- Brian ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing views of nested resources

2010-09-08 Thread Brennon Bortz
On 8 Sep 2010, at 16:20, Brennon Bortz wrote: > I've searched and searched, and just can't find an answer on the list or > elsewhere. Forgive me if I'm missing something... > > I've got the following bits of code: > > ### app/controllers/widget_layouts_controller.rb: > class WidgetLayoutsContr

[rspec-users] Testing views of nested resources

2010-09-08 Thread Brennon Bortz
I've searched and searched, and just can't find an answer on the list or elsewhere. Forgive me if I'm missing something... I've got the following bits of code: ### app/controllers/widget_layouts_controller.rb: class WidgetLayoutsController < ApplicationController def new @widget = Widget.