redding / assert

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

`Factory.test` now takes "flexible" args #161

Closed kellyredding closed 10 years ago

kellyredding commented 10 years ago

Before the test factory expected rigid args to be passed. It used intelligent defaults but if one arg was needed to passed, they all had to be.

This changes the factory to take whatever args it is given and interpet them based on the value. This allows you to pass only a name or only a context info if you like.

To make this happen, I had to update the test .new signature to take its optional values as a hash of options. This gave me an easy way to keep the factory and test signatures the same but have a distinct value type to interpret on. This also scales nicely as I'll need to optionally inject a config object in to tests when I change the config to no longer be a singleton.

Related to #154.

@jcredding ready for review.

jcredding commented 10 years ago

@kellyredding - Cool, looks good to me :boom: