Week 1, day 3

The plan was to do an athletic restart of our behaviour-driven design (BDD) for the Boris Bikes challenge but since my pair-programming partner was not going to be here tomorrow because of his final exams we decided to carry on and finish the exercise. If we're meant to be agile then let's be agile!

 1 require 'garage'
 2 describe Garage do
 3   subject { described_class.new(capacity: 20) }
 4   it 'can set a default capacity on initialising' do
 5     expect(subject.capacity).to eq(20)
 6   end
 7   it "can fix broken bikes" do
 8     garage = Garage.new
 9     working_bike = double :working_bike, broken?: false
10     broken_bike  = double :broken_bike,  broken?: true
11     garage.dock(working_bike)
12     garage.dock(broken_bike)
13     expect(broken_bike).to receive(:fix)
14     garage.fix_broken_bikes
15   end
16 end

Yesterday we had created tests to determine if we could dock and release bikes, consequently creating the code for the applications so we could pass our tests, and also set the foundations for breaking bikes.

Today we were to expand our docking capabilities out of a single docking class so that it could be reused in multiple things that could dock bikes, such as vans to transport broken bikes to garages, which would then receive and fix the bikes, and then have the van transport them back to their respective docking stations.

To achieve this we created a new module to be included in the various classes that would need that functionality.

The morning and afternoon stand-ups and break-outs seem to be working well, although it may be too early to tell. It definitely feels like a better use of our time so we can get on with implementing code, inevitably making mistakes and stumbling, allowing us to learn. Ruby is fun.

For the last couple of hours we did struggle with writing suitable tests to determine whether a bike could be broken and could be fixed. After writing the tests we wrote the application code to comply with the tests.

Written on March 18, 2015