Skip to content

Commit

Permalink
Add constants related specs
Browse files Browse the repository at this point in the history
  • Loading branch information
boddhisattva committed Jun 24, 2024
1 parent 6ec2383 commit 5bddd1a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/lib/path_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

describe Path do
it 'has a LEFT constant' do
expect(Path::LEFT).to eq('L')
end

it 'has a RIGHT constant' do
expect(Path::RIGHT).to eq('R')
end

it 'has a MOVE constant' do
expect(Path::MOVE).to eq('M')
end
end
9 changes: 9 additions & 0 deletions spec/lib/rover_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
describe Rover do
let(:terrain) { RectangularPlateau.new(0, 0, 5, 5) }

it 'has a COMPASS_DIRECTION constant' do
expect(Rover::COMPASS_DIRECTION).to eq({
'N' => 'North',
'S' => 'South',
'W' => 'West',
'E' => 'East'
})
end

describe '#traverse' do
context 'when given a rover that wants to travel through a valid path in a given terrain' do
it 'explores the terrain based on the specified navigation path' do
Expand Down

0 comments on commit 5bddd1a

Please sign in to comment.