Arup,

Can you post your spec and exception. These should work on 2.14. If you are
on RSpec 3, you need to either switch to the new syntax (
https://www.relishapp.com/rspec/rspec-mocks/v/3-0/docs/basics/allowing-messages)
or configure the old syntax (
https://www.relishapp.com/rspec/rspec-mocks/v/3-0/docs/old-syntax).

Here is a sample with the new syntax:

    allow(obj).to receive(:message).and_return(value)

Cheers!



On Thu, Jul 3, 2014 at 9:10 AM, Arup Rakshit <[email protected]> wrote:

> I have the below code :
>
> class Foo
>   def intialize
>     #
>   end
>
>   def meth
>     OpenStruct.new(val : meth1, val: meth2)
>   end
>
>   private
>
>   def meth1
>     #..
>   end
>
>   def meth2
>     #..
>   end
> end
>
> How can I stub those 2 private methods *meth1* and *meth2*.  *should*
> wouldn't work for me, as mentioned here -
> http://stackoverflow.com/questions/14987141/rspec-stub-private-method
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rspec/CAKxHnE1pcqwjoFukaqX9BymAyF_xGhm_GiUeOgk6DnqMg1zHqA%40mail.gmail.com
> <https://groups.google.com/d/msgid/rspec/CAKxHnE1pcqwjoFukaqX9BymAyF_xGhm_GiUeOgk6DnqMg1zHqA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CAKCESdhTdm10GWKSm5sohVLp-5MhsgFXr%2BcRCRTO0y0qNQZZrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to