Skip to content

Commit f878a07

Browse files
refactor: moved the obstacle tests to a more sensible place.
1 parent 718b957 commit f878a07

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

spec/moving_a_mars_rover_backwards_spec.rb

+14-14
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,6 @@
5757
expect(mars_rover).to be_located_at(expected_coordinates)
5858
end
5959

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-
7460
context 'at the edge of the western hemisphere' do
7561
it 'moves into the eastern hemisphere' do
7662
starting_location = Location.new(direction: 'W', coordinates: Coordinates.new(x: 35, y: 5))
@@ -136,5 +122,19 @@
136122
expect(mars_rover).to be_located_at(Coordinates.new(x: 0, y: -8)).and be_facing('S')
137123
end
138124
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
139139
end
140140
end

0 commit comments

Comments
 (0)