1. Nov 7th, 2005

    Natural language for test cases

    Christian Neukirchen has an interesting idea for writing test cases in Ruby. It looks something like this:

    tag Sheet, :interface do  given { @sheet = Sheet.new }.expect {    cells_are_empty_by_default {      doing { @sheet.get("A1") }.      results_in ""
    
          doing { @sheet.get("ZX347") }.      results_in ""    }  }end 

    You can read all the details and see the longer examples on his blog.

    I think it’s outright brilliant. It’s more than Yet Another Test Cases DSL, the syntax looks intuitive and natural. And we all know having fun writing test cases, just leads to more test cases and better code. I’d love to see that happen.

    Your comment, here ⇓