waterlink / spec2.cr

Enhanced `spec` testing library for [Crystal](http://crystal-lang.org/).
MIT License
103 stars 22 forks source link

Refactor `interfaces` to use composition over inheritance #27

Closed marceloboeira closed 8 years ago

marceloboeira commented 8 years ago

For instance the Reporter class becomes a module that can be included in any class, without enforcing the class to inherit from the old abstract class.

Basically this implies that any class can act as a 'reporter', yet it does not need actualy to inherits from it, if implements the necessary interface.

Affected interfaces: Matcher, Order, Output, Reporter, Runner

waterlink commented 8 years ago

Looks good to me.

PS: this will break spec2-mocks.cr library, since it defines matcher in old style.

waterlink commented 8 years ago

I have released 0.5.0 with this change and updated the README accordingly.

Now I will update spec2-mocks.cr library to use new style of matcher.

waterlink commented 8 years ago

I have released 0.2.0 of spec2-mocks.

marceloboeira commented 8 years ago

@waterlink thanks! :dancers: