We recently accidentally moved a method from public to private and it was 
not caught by our test suite because expect(obj).to receive(:method) 
succeeds regardless of whether or not obj.method is actually accessible or 
not.

I'm not sure if there's an easy way to get around this (because it should 
be possible to stub out private methods of course). I can't think off hand 
of a way to determine if the object has access to a method without calling 
it, which obviously an expectation shouldn't be doing generally. Maybe we 
can check if the receiver is self?

If there's a way to do this, it'd be nice to have this as a configuration 
option!

Thanks,
Daniel Vandersluis

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/c0d84ace-2f0d-4730-83d9-e4649a36d02en%40googlegroups.com.

Reply via email to