Sessions at RubyConf 2011 about Ruby and Test DrivenĀ Development

Your current filters are…


Thursday 29th September 2011

  • Why You Don't Get Mock Objects

    by Gregory Moeck

    Although the Ruby community has embraced TDD like no other community ever has, we have always looked at mock objects with disdain, and perhaps even a little hatred. I've heard conference speakers call them "Wastes of time", "Scams", and even "Testing Heresies". Why would anyone have ever developed these pieces of junk?

    In reality though many in the agile community have embraced mock objects within their testing cycles because they have found using these fake objects improves the design of their systems. But why not Rubyists? Most Rubyists don't get mock objects because they don't understand their history or their creators intent. They try to fit them into their current workflow without understanding them, and find them unhelpful and stupid. After all, almost all of the good literature on the subject is written in Java, and we know how frustrating it is to read Java when your used to Ruby.

    As such, this talk will attempt to demonstrate in Ruby the usefulness of mock objects, and how to use them to improve the design of your system.

    Specifically the following will be covered:

    • Why do we need mock objects (Following the 'Tell, Don't Ask Principle')
    • Why you should only mock objects you own
    • Why you shouldn't use mocks to test boundary objects like external API calls
    • Why you should mock roles, not Objects
    • Why you should only mock your immediate neighbors
    • Why listening to your unit tests will tell you about design problems in your code

    At 11:15am to 12:00pm, Thursday 29th September

Friday 30th September 2011

  • Test-drive the development of your command-line applications

    by David Copeland

    Rubyists love testing, and test-driven-development is becoming THE way to write code. But, do we do this with our command-line tools? How DO you write a test that your awesome application cleans up its temp files? How does one make a failing test for a missing command-line option? What's the easiest way to check our app's exit codes? This talk will answer these questions with some real-world examples. We'll talk briefly about the challenges particular to testing command-line apps, and then dive into some code where we'll show off techniques for organizing code for testability, tools for interacting with the filesystem, and how to create full-blown acceptance tests for your command-line app. In no time, you'll be able to write your command-line apps the same way you write your other code: test-first.

    At 2:20pm to 3:00pm, Friday 30th September

Schedule incomplete?

Add a new session

Filter by Day

Filter by coverage

Filter by Topic