Forum: RSpec How to test the code inside the block of the to_xml function?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0bd8b10ad45ca639c1183ca0581c79ab?d=identicon&s=25 Alex (Guest)
on 2009-02-10 20:49
(Received via mailing list)
Hi all, when I spec the to_xml function like this:
@some_model.should_receive(:to_xml), it dskips the code located in the
block, here is the controller code:

output = @detenteur.to_xml( :skip_types => false, :skip_instruct =>
true, :dasherize => false, :only => [:inte_no] ) do |xml_detenteur|
lots of code...

How can I test the code inside?

5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-02-12 05:49
(Received via mailing list)
On Fri, Feb 6, 2009 at 3:12 PM, Alex <> wrote:
> How can I test the code inside?
mock_xml_detenteur = mock('xml_detenteur')
# set expectations on mock_xml_detenteur

Make sense?
This topic is locked and can not be replied to.