[rspec-users] Outside-In with RSpec on Rails

2007-07-06 Thread Jed Hurt
I just read 'Mocks Aren't Stubs' and was intrigued by the notion of 'outside-in' TDD. As a Rails developer, I'm curious if others are employing this method when developing Rails applications using RSpec. Is it common practice (or even practical) to drive the development of a Rails app by starting

Re: [rspec-users] Outside-In with RSpec on Rails

2007-07-06 Thread Jed Hurt
Cool. I'll have to give it a try on my next project. On 7/6/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/6/07, Jed Hurt <[EMAIL PROTECTED]> wrote: > > I just read 'Mocks Aren't Stubs' and was intrigued by the notion of > > 'outside-i

[rspec-users] expect_render twice in views

2007-07-14 Thread Jed Hurt
I found this: controller.expect_render(:partial => 'thing', :collection => things).once but I am trying to expect_render twice in my view spec: template.expect_render(:partial => 'order_details').twice This doesn't work as the template.expect_render call seems to be returning an array. Is it p

Re: [rspec-users] expect_render twice in views

2007-07-14 Thread Jed Hurt
Works like a charm. Thanks! On 7/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/14/07, aslak hellesoy <[EMAIL PROTECTED]> wrote: > > On 7/14/07, Jed Hurt <[EMAIL PROTECTED]> wrote: > > > I found this: > > > > > > controller.expect_r

[rspec-users] alias :calling :lambda

2007-09-19 Thread Jed Hurt
Sprinkling my examples with 'lambda' has always seemed like a bit of a wart to me. I've gotten into the habit of adding 'alias :calling :lambda' to my spec suites. My examples then look like: calling { Foo }.should raise_error calling { Bar }.should_not raise_error Is there a reason that RSpec co

Re: [rspec-users] alias :calling :lambda

2007-09-20 Thread Jed Hurt
9/19/2007 11:04 PM, Scott Taylor wrote: > > On Sep 19, 2007, at 10:17 PM, Jed Hurt wrote: > > > >> Sprinkling my examples with 'lambda' has always seemed like a bit of a > >> wart to me. I've gotten into the habit of adding 'alias :calling > >

[rspec-users] Stub ActionController::Base#params

2007-10-15 Thread Jed Hurt
Has anyone had any success stubbing ActionController::Base#params? The following is not intercepting calls to params[:foo] in my controllers: ActionController::Base.stub!(:params).and_return(:foo => 'bar') ___ rspec-users mailing list rspec-users@rubyfor

Re: [rspec-users] Stub ActionController::Base#params

2007-10-15 Thread Jed Hurt
t @controller, whereas before I was running each of my expectations against a new instance of ActionController::Base ( i.e. ActionController::Base.new.should...) On 10/16/07, Jed Hurt <[EMAIL PROTECTED]> wrote: > > Has anyone had any success stubbing ActionController::Base#param

[rspec-users] TextMate Sidebar

2007-12-06 Thread Jed Hurt
Hey David, I just watched the RubyConf recording of your RSpec session and noticed that you're using a modified version of TextMate that uses a sidebar instead of a project drawer. Where did you find that mod? ___ rspec-users mailing list rspec-users@ruby

[rspec-users] Quiet Backtrace in RSpec

2008-01-18 Thread Jed Hurt
I'm using RSpec on Rails and would like to clean up the backtraces, so I went looking for an RSpec equivalent to ThoughtBot's Quiet Backtrace gem. I found Spec::Runner::QuietBacktraceTweaker in the RDOCS, but I can't figure out how to use it. Can I add

Re: [rspec-users] Quiet Backtrace in RSpec

2008-02-20 Thread Jed Hurt
Ahh, I see. Is Spec::Runner::QuietBacktraceTweaker configurable for more quietness? On Sat, Jan 19, 2008 at 1:39 AM, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On Jan 19, 2008 4:16 AM, Jed Hurt <[EMAIL PROTECTED]> wrote: > > I'm using RSpec on Rails and would like to c

Re: [rspec-users] Quiet Backtrace in RSpec

2008-02-29 Thread Jed Hurt
On Thu, Feb 21, 2008 at 6:21 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Thu, Feb 21, 2008 at 12:52 AM, Jed Hurt <[EMAIL PROTECTED]> wrote: > > Ahh, I see. Is Spec::Runner::QuietBacktraceTweaker configurable for more > > quietness? > > Nope.

Re: [rspec-users] Quiet Backtrace in RSpec

2008-02-29 Thread Jed Hurt
Ahh, I see. Cool, cool :) On Fri, Feb 29, 2008 at 2:52 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Fri, Feb 29, 2008 at 1:08 PM, Jed Hurt <[EMAIL PROTECTED]> wrote: > > > > > > > > On Thu, Feb 21, 2008 at 6:21 AM, David Chelimsky <[EMAIL PROTECT

[rspec-users] Stub an instance method for every new instance of a class

2008-03-31 Thread Jed Hurt
Is there an easy way to stub an instance method for every new instance of a given class? I suppose I could just redefine the method, but I'm wondering if the RSpec mocking framework has this built in. ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] Stub an instance method for every new instance of a class

2008-04-01 Thread Jed Hurt
ke in Rails) because the controller is instantiated after calling dispatch. I suppose I could whip up a different sort of hack to accomplish the isolation in the meantime, but now I'm not so sure; apparently I'm quite a noob ;) On Tue, Apr 1, 2008 at 1:50 AM, Ashley Moran <[EMAIL PROTECT

Re: [rspec-users] Stub an instance method for every new instance of a class

2008-04-01 Thread Jed Hurt
, Corey Haines <[EMAIL PROTECTED]> > wrote: > > Could you stub out Controller.new and return your mock? > > Bingo. > > > > > > > > > On Tue, Apr 1, 2008 at 1:19 PM, Jed Hurt <[EMAIL PROTECTED]> wrote: > > > Haha, that's about the respons

Re: [rspec-users] Stub an instance method for every new instance of a class

2008-04-02 Thread Jed Hurt
n 'sweetness' > > Something like this? > > -Corey > > On Wed, Apr 2, 2008 at 12:22 AM, Jed Hurt <[EMAIL PROTECTED]> wrote: > > > I'm not sure how that would work. For controller specs, I want to keep > > most of the controller intact so that I can