NWRUG

North West Ruby User Group

NWRUG Quiz: The Bowling Exercise

We'll be doing the Bowling exercise from Exercism.io. The idea is to write some code that can score a bowling game!

Getting started

  • Follow the installation instructions for excercism to get set up if you haven't already
  • You'll also want to install the Minitest gem by running the following command from your terminal: gem install minitest

Doing the exercise

  • Run exercism download --exercise=bowling --track=ruby to install the exercise
  • Find the "Bowling" exercise in the "Ruby" track on Exercism.io to see further instructions

The test suite can be run by running the following command from the project directory:

ruby bowling_test.rb

The test suite contains one failing test and many skipped tests. Your goal is to write code that passes all of the tests. Compete the exercise by following these steps:

  • run the tests and note the failure
  • write only enough code to pass the failing test
  • unskip the next test

Repeat the steps until no tests are skipped and you've written code to pass them all.

Extra challenge: apply the Baby Steps constraints

If you are both experienced developers and would like a further challenge, you might consider applying the Baby Steps constraint:

Rules

  • Setup a git repository (or use another SCM that supports resets)
  • Setup a timer for 2 minutes interval when you start
  • Write exactly one test
  • If the timer rings and the test is red then revert and start over
  • If you finish your test earlier: no problem, reset the timer and continue
  • Restart timer Go to 3.

Hints

  • Most pairs need to reset at least once
  • It is absolutely OK to spend iterations to do only refactorings
  • Feel free to discuss whatever is needed in between cycles
  • The most important part is to have green tests. Your code base must never be red for more than two minutes