main
1require 'spec_helper'
2
3describe South do
4 let(:sut) { South.new }
5 context "when driving forward" do
6 let(:plateau) { Plateau.new(5, 5) }
7 it "should move forward" do
8 @location.current(:y).should == 0
9 end
10 before do
11 @location = Location.new(0, 1, sut)
12 sut.forward(@location, plateau)
13 end
14 end
15 context "when turning left" do
16 it "should face east" do
17 sut.turn_left.should be_an_instance_of(East)
18 end
19 end
20 context "when turning right" do
21 it "should face west" do
22 sut.turn_right.should be_an_instance_of(West)
23 end
24 end
25 context "when displayed" do
26 it "should display 'S'" do
27 sut.to_s.should == 'S'
28 end
29 end
30end