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