Skip to content

Comments

James branch#23

Open
hurndallj wants to merge 24 commits intomainfrom
james-branch
Open

James branch#23
hurndallj wants to merge 24 commits intomainfrom
james-branch

Conversation

@hurndallj
Copy link

No description provided.

end

def execute
case @current_direction

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


def initialize(starting_point:, starting_direction:, commands: [])
raise ArgumentError, 'The starting direction must be one of N, E, S or W' unless ['N', 'E', 'S', 'W'].include? starting_direction
raise ArgumentError, 'The starting point cannot be nil' if starting_point.nil?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found an issue: Add empty line after guard clause.

@@ -0,0 +1,127 @@
describe 'Mars Rover' do
class MarsRover

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when 'W'
@current_position = [x_coordinate - 1, y_coordinate]
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect { MarsRover.new(starting_point: [-3, 1], starting_direction: ['N', 'E', 'S', 'W']) }.to(
raise_error(ArgumentError, 'The starting direction must be one of N, E, S or W')
)
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found an issue: Add an empty line after it.

@@ -0,0 +1,127 @@
describe 'Mars Rover' do
class MarsRover

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant