Re: [rspec-users] Returning a StringIO object from a stub

2009-11-12 Thread JGailor
Thanks Paul, As soon as I read the first part of your message I had one of those face-palm moments. Thanks for your help. In the case of this expectation, I'm not sure which path I'll take as this particular test is looking for it to read a certain number of lines of input before finding the tar

Re: [rspec-users] Returning a StringIO object from a stub

2009-11-11 Thread Paul Hinze
JGailor on 2009-11-11 at 16:11: > I'm trying to stub File.new so I can return a StringIO object from it > to set some expectation and make sure the subject under test is > behaving correctly, but calling readline() on the StringIO object in > the subject always returns nil. > > data = <<-DATA >

[rspec-users] Returning a StringIO object from a stub

2009-11-11 Thread JGailor
I'm trying to stub File.new so I can return a StringIO object from it to set some expectation and make sure the subject under test is behaving correctly, but calling readline() on the StringIO object in the subject always returns nil. What's strange is that calling read() returns the entire set of