On Saturday, July 05, 2014 08:09:30 AM Xavier Shay wrote:
> On 4/07/2014 8:48 pm, Arup Rakshit wrote:
> >> If you actually just use method_missing and don't define the method,
> >
> >> then the spec will fail:
> > Ahh. Get it.
> >
> > Okay. So, now to make it pass, what I need to do, without using
> > #define_method.
> Just implement respond_to?:
>
> class Foo
> def method_missing(name,*args,&block)
> "#{name} has been defined dynamically"
> end
>
> def respond_to?(method_name, include_all=false)
> true
> end
> end
>
> >> class Foo
> >>
> >> def method_missing(name,*args,&block)
> >>
> >> "#{name} has been defined dynamically"
> >>
> >> end
> >>
> >> end
> >>
> >> Hope that helps,
> >> Xavier
Thanks Xavier.
--
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Brian Kernighan
--
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/2035855.UXyP2Uhnub%40linux-wzza.site.
For more options, visit https://groups.google.com/d/optout.