RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

A proposal for better mocks

After reading “Growing Object-Oriented Software Guided by Tests” (GOOS), I finally stopped worrying and learned to love the “mockist” or “London School” of TDD. However, the unfortunate fact of this style in Ruby is that tests using mocks can easily find themselves out of sync with the concrete implementations instructed into existence by those mocks, especially when making adjustments to the design of the system.

To that end, I imagined an approach which could resolve the issue with minimal effort. This is a hypothetical syntax, and I haven’t started actually implementing it. I thought I’d throw it out to the community for discussion and maybe get the ball rolling on something like it (or something better). See the Gist.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in