redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

Stub system tests for mixed in and inherited methods #202

Closed jcredding closed 10 years ago

jcredding commented 10 years ago

This adds some system tests for stubbing methods that are either mixed in (via include or extend) or inherited. The goal is to throughly test assert's stubbing in the same way it would be used in a separate test suite and to find any strange issues that can come from mixing stubs or using them in strange scenarios. These include edge cases and error cases that ensure assert's stubbing tries to alert the users to possible issues as much as possible. The biggest difference for these kinds of methods is for extended or inherited class methods assert doesn't check arity when stubbing or calling the method. For included or inherited instance methods it does check arity.

This also adds system tests for stubbing a method on a class and a class that inherits from it. In this case, it stubs new on both the parent class and the child class and ensures they can be stubbed individually without effecting the other.

@kellyredding - Ready for review.

kellyredding commented 10 years ago

@jcredding we discussed singleton stubbing of inherited methods. Add in the tests covering that here and I'm good with this :-1:

jcredding commented 10 years ago

@kellyredding - I updated this with a ParentAndChildTests context that ensures the same method can be stubbed on a parent and child class and work as expected.

kellyredding commented 10 years ago

@jcredding one comment, otherwise I'm good here. :-1: