redding / assert

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

have tests capture their data in a specific "data" object #228

Closed kellyredding closed 9 years ago

kellyredding commented 9 years ago

This is prep for making working with test/result data more flexible and ultimately prep for implementing Parassert. Parassert will use these data objects to store test run info in a db and then rebuild the data from the db when outputting test results.

In theory, test/result data is all that is needed to render test output in the view (as opposed to the actual objects). In order to transition the views to using these "data" objects, we first need to start collecting the data in the tests.

This adds the test data object and updates the test to compose it for any applicable logic. This allows us to get the data object in place while avoiding double-storing the test attrs.

In a future effort, I'll add the result data object and then switch the views/runner to use the data objects when outputting results.

Additionally, I updated how the results are captured and how the result callback is handled. I didn't want to store the callback as mutable state so this switches to passing the callback around as needed. This allowed me to remove the superfulous Result::Set class.

@jcredding ready for review.

jcredding commented 9 years ago

@kellyredding - Looks good :boom: