Forum: RSpec How to spec within a block?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
161c0829c95d759f4dc0e0b71f712109?d=identicon&s=25 Rémi Gagnon (rgagnon)
on 2009-02-08 13:46
(Received via mailing list)
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
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-02-08 16:38
(Received via mailing list)
On Sun, Feb 8, 2009 at 6:44 AM, Remi Gagnon <rem.gagnon@gmail.com>
wrote:
>           get_object_xml( @detenteur.intervenant_adresses,
>
> Thank you

I'm not sure I understand your goal here. Can you show us what the
spec you'd like to be able to write?
49de4cd2f26705785cbef2b15a9df7aa?d=identicon&s=25 Nick Hoffman (nickh)
on 2009-02-08 17:08
(Received via mailing list)
On 08/02/2009, at 7:44 AM, Remi Gagnon wrote:
>           p "INTERVENANT ADRESSES"
>
> Thank you
>
> Rémi

Hi Rémi. If you show us what you've written so far, we can give you
some tips.

Cheers,
Nick
This topic is locked and can not be replied to.