🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

spec yoda will

Published 2009-04-24 @ 00:05

Tagged Seattle.rb, toys

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Bowling
  def hit(pins)
  end

  def score
    0
  end
end

require 'yoda'

Bowling.yoda {
  "score 0 for gutter game".it_will {
    bowling = Bowling.new
    20.times { bowling.hit(0) }

    bowling.score 0.it_is
    bowling.score 42.it_is_not!
  }
}

This is what happens when Aaron Patterson and I hack together. Be afraid. Be very afraid.