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@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'
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
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
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