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