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
--
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/53B8152A.2010608%40xaviershay.com.
For more options, visit https://groups.google.com/d/optout.