waterlink / spec2.cr

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

Method stubbing through allow, to_receive, and to_return macros #63

Closed watzon closed 6 years ago

watzon commented 6 years ago

This idea comes straight from rspec, which this library is very similar to. I don't know if it's possible in Crystal or not, but with rspec you can stub methods using the syntax allow(Class).to receive(method).and_return(return_value). An example of this can be seen here

watzon commented 6 years ago

Actually just found waterlink/mocks.cr We're all good.