This isn't so much an issue with the example itself, but the example does highlight something. Should PLACE 1, 2, NORTH really be considered an invalid command? Think of writing down a phone number; some may write is as 0400111222, others will use spaces to make it easier to read, 0400 111 222. Is the latter an invalid number?
Creating a more lenient regex that can account for spaces between the arguments, or even lowercase arguments is not a big stretch for the code, but could make the application much more user friendly.
agreed. But when a template is provided for a command its better to stick to template. The txt file gave them a template and recommendation is to stick to the template. :)
https://github.com/KarthickNarayana/toy_robot/blob/3d570a92d5c8b027e2456ec4f7bce47223719ecf/spec/toy_robot/command_spec.rb#L13
This isn't so much an issue with the example itself, but the example does highlight something. Should
PLACE 1, 2, NORTH
really be considered an invalid command? Think of writing down a phone number; some may write is as 0400111222, others will use spaces to make it easier to read, 0400 111 222. Is the latter an invalid number?Creating a more lenient regex that can account for spaces between the arguments, or even lowercase arguments is not a big stretch for the code, but could make the application much more user friendly.