I want to test my test doubles to make sure they are valid test doubles. e.g. a double for class A needs to present the same API as class A so that if the real class A changes its API, the tests will tell me that my test doubles also need to change.
Layered on top of this is I have classes A, B, C, and D that need to implement a common API. I can solve the first problem with shared examples. I can create a shared example for class A and make sure that class A implements what what the shared example tests as well as make sure that any doubles pretending to be class A also implements whatever the shared example tests. Likewise, I can create shared examples for class B, C, and D. Now I'd like to pull out the common code into its own shared example but I'm not clear how to do that. One response could be that I pull the common code for class A, B, C, and D out to a module and then implement a shared example for this new common module. In my case, I can't find a nice way to do that. The implementation inside the classes to implement the API differs slightly. All that to ask the question: how can I have a shared example inside another shared example? Thank you for your help, Perry -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
