Re: [rspec-users] rendering xml with haml through render_template is invalid

2011-09-08 Thread David Chelimsky
On Sep 8, 2011, at 8:52 PM, Stephen Bannasch wrote: > I have some controller tests for validity of restful XML responses. > > I'm using haml to generate the xml. > > When I test externally with curl the response is well-formed XML. > > However when I test the controllers with rspec2 the respons

[rspec-users] rspec and testing IO

2011-09-08 Thread Justin Beck
; rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > Two ways to approach this. On the unit level, you can stub "gets" and return > a different value each time: > > stubs(:gets).and_return('yes', 'no'

[rspec-users] rendering xml with haml through render_template is invalid

2011-09-08 Thread Stephen Bannasch
I have some controller tests for validity of restful XML responses. I'm using haml to generate the xml. When I test externally with curl the response is well-formed XML. However when I test the controllers with rspec2 the response is invalid XML. The following code is part of an rspec shared_e

Re: [rspec-users] rspec and testing IO

2011-09-08 Thread Justin Ko
On Thu, Sep 8, 2011 at 3:03 PM, Justin Beck wrote: > I have a class that expects some input via 'gets'. I found that, when > testing, I can do something as simple as this: > > @foo.stub!(:gets) { "stuff\n" } > > However that only works in the most simple case. In my case the class asks > a seri

[rspec-users] rspec and testing IO

2011-09-08 Thread Justin Beck
I have a class that expects some input via 'gets'. I found that, when testing, I can do something as simple as this: @foo.stub!(:gets) { "stuff\n" } However that only works in the most simple case. In my case the class asks a series of questions that require a yes/no answer culminating in som