Hi, In the relish doc :-
https://www.relishapp.com/rspec/rspec-expectations/v/3-0/docs/built-in-matchers/respond-to-matcher Note that this matcher relies entirely upon #respond_to?. If an object dynamically responds to a message via #method_missing, *but does not indicate this via #respond_to?*, then this matcher will give you false results. What does the *..* line mean ? The below test simply passes :- #!/usr/bin/env ruby class Foo def method_missing(name,*args,&block) self.class.send(:define_method, name) do "#{name} has been defined dynamically" end end end rspec :- require_relative "../test.rb" describe Foo do before { subject.foo } it "defines #foo dynamically" do expect(subject).to respond_to(:foo) end end I am not able to connect the line I marked with *..* with this example.... :( -- ================ 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/3378385.yhmgCfUP9s%40linux-wzza.site. For more options, visit https://groups.google.com/d/optout.
