diff --git a/spec/lib/path_spec.rb b/spec/lib/path_spec.rb new file mode 100644 index 0000000..2ef2896 --- /dev/null +++ b/spec/lib/path_spec.rb @@ -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 diff --git a/spec/lib/rover_spec.rb b/spec/lib/rover_spec.rb index 0ea6708..59f0641 100644 --- a/spec/lib/rover_spec.rb +++ b/spec/lib/rover_spec.rb @@ -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