On Fri, May 11, 2012 at 9:24 AM, Alexandre de Oliveira < chavedomu...@gmail.com> wrote:
> Hey guys, could you help me (in)validating an idea? > > As you might know, Contract tests solve a problem stubs have: if the > object interface changes, the stubbed tests will continue passing. > > In RSpec, it's common to use a shared_context to describe contracts, so > both Posts and Comments tests would have PostsCommentsContract. If > Comment's interface ever changed, Posts tests would present a failure > wherever we ran it. However, it won't tell us which stubbed methods were > invalid now; it just tell us the file that have invalid stubs. > > If we had, for example, #stub_contract(:method), automatically raising > a failure if its reference (double) object's interface changed, how would > it be bad? > > I'm trying to think the cons of it. Could you guys help me finding it? > See https://github.com/rspec/rspec-mocks/issues/15
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users