Commit d4cfc70

mo k <mo@mokhan.ca>
2012-11-07 03:45:12
add scenarios for lower case instructions.
1 parent e60df2c
lib/console.rb
@@ -40,4 +40,3 @@ class Console
     end
   end
 end
-
lib/move_forward.rb
@@ -8,6 +8,6 @@ class MoveForward
     end
   end
   def matches(item)
-    'M' == item
+    'M' == item.upcase
   end
 end
lib/turn_left.rb
@@ -6,6 +6,6 @@ class TurnLeft
     @rover.rotate(-90) if matches(instruction)
   end
   def matches(item)
-    'L' == item
+    'L' == item.upcase
   end
 end
lib/turn_right.rb
@@ -6,6 +6,6 @@ class TurnRight
     @rover.rotate(90) if matches(instruction)
   end
   def matches(item)
-    'R' == item
+    'R' == item.upcase
   end
 end
spec/features/navigation.feature
@@ -30,3 +30,6 @@ Feature: Navigation
       | 1 | 1 | 0 1 E             | M    | 1 1 E  |
       | 1 | 1 | 0 1 W             | M    | 1 1 W  |
       | 1 | 1 | 0 1 S             | M    | 0 0 S  |
+      | 1 | 1 | 0 0 N             | m    | 0 1 N  |
+      | 1 | 1 | 0 0 N             | l    | 0 0 W  |
+      | 1 | 1 | 0 0 N             | r    | 0 0 E  |