Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Phillip Koebbe
On 2010-03-20 12:17 PM, David Chelimsky wrote: On Sat, Mar 20, 2010 at 10:19 AM, Phillip Koebbe wrote: I would be glad to help in this way, but it will have to be later today. And instead of using completely made-up code, I'll use some of my real-world code and tests as an example. I

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread David Chelimsky
On Sat, Mar 20, 2010 at 10:19 AM, Phillip Koebbe wrote: > >> I would be glad to help in this way, but it will have to be later today. >> And instead of using completely made-up code, I'll use some of my real-world >> code and tests as an example. I'll gist them later, unless one of the gurus >> co

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Phillip Koebbe
I would be glad to help in this way, but it will have to be later today. And instead of using completely made-up code, I'll use some of my real-world code and tests as an example. I'll gist them later, unless one of the gurus comes along and provides enlightenment for you! I was able to ge

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Phillip Koebbe
On 2010-03-20 7:02 AM, Patrick J. Collins wrote: On Sat, 20 Mar 2010, Phillip Koebbe wrote: Welcome to RSpec, Patrick. For some of us, it's pretty rocky at first. I Thank you Phillip for your great explanation... After reading what you wrote, I have a few questions: 1. From what I

Re: [rspec-users] Insufficient database clean-up between specs

2010-03-20 Thread jollyroger
David and Matt, ok, i was under the impression that rspec would clean up the database. Got it working now, thanks for the help... On Mar 16, 11:10 am, Matt Wynne wrote: > On 15 Mar 2010, at 12:34, David Chelimsky wrote: > > > > > On Mon, Mar 15, 2010 at 7:24 AM, jollyroger > > wrote: > >> Hey

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Patrick J. Collins
On Sat, 20 Mar 2010, Phillip Koebbe wrote: > Welcome to RSpec, Patrick. For some of us, it's pretty rocky at first. I Thank you Phillip for your great explanation... After reading what you wrote, I have a few questions: 1. From what I understand of what you wrote, stub_model makes a fake objec

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Tom Stuart
Hi David, On 20 Mar 2010, at 10:42, David Chelimsky wrote: > There is an alternate syntax that I'm using nearly exclusively at this > point, which is to pass a block along with the stub() and > should_receive() messages: > [...] > I've been thinking of deprecating the and_xxx methods in rspec-2. D

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Patrick J. Collins
Hi David, > I've been thinking of deprecating the and_xxx methods in rspec-2. Does > anybody think that's an awful idea? Well I can tell you that this syntax you demonstrated: > foo.stub(:bar) { "return value" } > foo.stub(:bar) { raise SomeError } > foo.stub(:bar) { yield "value" } > fo

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Phillip Koebbe
There is an alternate syntax that I'm using nearly exclusively at this point, which is to pass a block along with the stub() and should_receive() messages: foo.stub(:bar) { "return value" } foo.stub(:bar) { raise SomeError } foo.stub(:bar) { yield "value" } foo.stub(:bar) { throw :v

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Phillip Koebbe
Welcome to RSpec, Patrick. For some of us, it's pretty rocky at first. I started using it a couple of years ago with models, and understood that well enough (I think). Then I came to controllers and I just couldn't wrap my mind around it. I gave up for quite some time. When I came back to testi

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread David Chelimsky
On Sat, Mar 20, 2010 at 2:28 AM, Patrick J. Collins wrote: > 4.  You do .stub! ...  This is where I get really > confused.  From the peepcode screencast that I have watched > several times, he explained that stubbing is the same as > mocking-- except there is no expectation of what it retu

Re: [rspec-users] stub vs stub!

2010-03-20 Thread David Chelimsky
On Fri, Mar 19, 2010 at 1:39 PM, David Chelimsky wrote: > On Mar 19, 2010, at 1:27 PM, Nick Hoffman wrote: > >> Pat Maddox wrote: >>> I've never heard of CurbFu, but according to >>> http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines >>> a stub method already.  So you're hitti

Re: [rspec-users] lots of nil problems!

2010-03-20 Thread Patrick J. Collins
Hi Nick, Thank you very much for your reply. One thing I am finding incredibly frustrating with Rspec, is that I don't even know what questions to ask-- because I find the whole thing so confusing. So forgive me, but I am going to break down your code and ask specific questions to hopefully gain