|
57 | 57 | expect(mars_rover).to be_located_at(expected_coordinates)
|
58 | 58 | end
|
59 | 59 |
|
60 |
| - describe 'encountering obstacles' do |
61 |
| - it 'moves to the last point before the obstacle and reports the coordinates of it' do |
62 |
| - obstacle_detector = ObstacleDetector.new([Coordinates.new(x: 1, y: 2)]) |
63 |
| - starting_location = Location.new(direction: 'N', coordinates: Coordinates.new(x: 1, y: 3)) |
64 |
| - mars_rover = mars_rover(starting_at: starting_location, obstacle_detector: obstacle_detector) |
65 |
| - |
66 |
| - mars_rover.execute(['b']) |
67 |
| - |
68 |
| - expect(mars_rover).to be_located_at(Coordinates.new(x: 1, y: 3)) |
69 |
| - end |
70 |
| - |
71 |
| - it 'moves multiple steps up to the last point before the obstacle' |
72 |
| - end |
73 |
| - |
74 | 60 | context 'at the edge of the western hemisphere' do
|
75 | 61 | it 'moves into the eastern hemisphere' do
|
76 | 62 | starting_location = Location.new(direction: 'W', coordinates: Coordinates.new(x: 35, y: 5))
|
|
136 | 122 | expect(mars_rover).to be_located_at(Coordinates.new(x: 0, y: -8)).and be_facing('S')
|
137 | 123 | end
|
138 | 124 | end
|
| 125 | + |
| 126 | + describe 'encountering obstacles' do |
| 127 | + it 'moves to the last point before the obstacle and reports the coordinates of it' do |
| 128 | + obstacle_detector = ObstacleDetector.new([Coordinates.new(x: 1, y: 2)]) |
| 129 | + starting_location = Location.new(direction: 'N', coordinates: Coordinates.new(x: 1, y: 3)) |
| 130 | + mars_rover = mars_rover(starting_at: starting_location, obstacle_detector: obstacle_detector) |
| 131 | + |
| 132 | + mars_rover.execute(['b']) |
| 133 | + |
| 134 | + expect(mars_rover).to be_located_at(Coordinates.new(x: 1, y: 3)) |
| 135 | + end |
| 136 | + |
| 137 | + it 'moves multiple steps up to the last point before the obstacle' |
| 138 | + end |
139 | 139 | end
|
140 | 140 | end
|
0 commit comments