Example #1
0
 def test_bowling_example(self):
     b = Bowling()
     for i in range(10):
         b.hit(0)
     Value(b.score).should == 0
     Value(b.score).should_not == 1
     Value(b).get.score.should == 0
Example #2
0
    def test_bowling_all_9s_should_be_90(self):
        b = Bowling()
        for i in range(10):
            b.hit(9)
        Value(b.score).should == 90

        v = Value(2)
        v += 2
        v.should == 4
Example #3
0
from __future__ import with_statement
from bowling import Bowling
from spyce import description, example
from should_dsl import should_be

with description(Bowling) as context:
    bowling = Bowling()

    with example("should score 0 for gutter game"):
        bowling.score |should_be| 0

    with example("should score 13 if I get a spare with 6 and 7"):
        bowling.hit(6)
        bowling.hit(7)
        bowling.score |should_be| 13