[rspec-users] How to spec within a block?

Remi Gagnon rem.gagnon at gmail.com
Sun Feb 8 07:44:44 EST 2009


I want to mock to Model.to_xml but not his block.  How to do it?

Here is what I have (sorry for the formatting)

      output = @detenteur.to_xml( :skip_types => false, :skip_instruct
=> true, :dasherize => false, :only => [:inte_no] ) do |xml_detenteur|
        p xml_detenteur.intervenant_adresses.class.to_s
        xml_detenteur.intervenant_adresses do
          p "INTERVENANT ADRESSES"
          get_object_xml( @detenteur.intervenant_adresses,
@detenteur.intervenant_adresses.obtenir_adresses_vigueur, {:builder =>
xml_detenteur, :skip_instruct => true, :skip_types => false,
:dasherize => false, :except => [:inte_no]})
        end
       end

So I want to run specs within some blocks like that.

Any recipes?

Thank you

Rémi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090208/82615c56/attachment.html>


More information about the rspec-users mailing list