main
 1require "navigate_rover"
 2
 3describe NavigateRover do
 4  let(:sut) { NavigateRover.new(plateau, starting_position, instructions ) }
 5
 6  describe "when navigating" do
 7    context "plateau of 5 by 5" do
 8      let(:plateau) { '5 5' }
 9
10      context "starting at 1 2 N" do
11        let(:starting_position) { '1 2 N' }
12        let(:instructions) {'LMLMLMLMM' }
13
14        it "should reply with the proper final coordinates" do
15          sut.run.should == '1 3 N'
16        end
17      end
18      context "starting at 3 3 E" do
19        let(:starting_position) { '3 3 E' }
20        let(:instructions){'MMRMMRMRRM'}
21
22        it "should reply with the proper final coordinates" do
23          sut.run.should == '5 1 E'
24        end
25      end
26    end
27  end
28end