add-memberalign-toparrow-leftarrow-rightbellblockcalendarcamerachatchevron-leftchevron-rightchevron-small-downchevron-upcircle-with-crosscomposecrossfacebookflagfolderglobegoogleimagesinstagramkeylocation-pinmedalmoremuplabelShape 3 + Rectangle 1pagepersonpluspollsImported LayersImported LayersImported LayersshieldstartwitterwinbackClosewinbackCompletewinbackDiscountyahoo

Mocks vs. Stubs

I've been playing a lot with RSpec mocks and stubs in Rails recently. They are confusing and there are so many ways you can use them. I'd like to talk about the main differences between mocks and stubs, demonstrate them through a sample Rails project. ========================= Here is more info on what I'll cover: We'll be looking at some basic Ruby mocking/stubbing examples. My goal is to describe the difference between the two, focusing on the technique and not on the different mocking tools. I also built a Twitter client in Rails. I'll use that app to show you how http stubs are used to fake out service calls. Cucumber will run against this app without ever hitting the Twitter API servers. Hope to see you there!

Join or login to comment.

  • Attila D.

    The slides for my "Mocks vs Stubs" talk is finally posted on my blog:

    I have a github repo link there with the examples.

    December 27, 2010

  • Patrick S.

    Attila did a great job exploring the differences between the two isolation techniques, and via a variety of tools. Joe's demo of how he isolated himself from system resources during his work on Vimmer was also very cool.

    December 7, 2010

  • Joe F.

    Attila gave an excellent, unbiased talk on mocks vs. stubs. He objectively explored the difference between the two and explained it very well.

    December 3, 2010

  • Bill C.

    This sounds Great! Thanks!

    November 29, 2010

  • Attila D.

    Not at all!

    November 4, 2010

  • Joe F.

    Would you mind if I did a lightning talk after your presentation on test doubles and the rr (double ruby) library?

    November 4, 2010

20 went

Our Sponsors

  • LeanDog

    An Agile Software Studio

  • BoxCast

    Streaming live and recorded video of our meetup's presentations.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy