Debugging... Ahh, the life blood of developers. Okay let's get straight to work!
This gist contains individual exercises (one per file) for you to work through, in order. Fork and clone it and run through each file (in order) and fix the bugs in the code.
For now, we are keeping both the logic code and the test code for each exercise in one file. This is for simplicity since the code is minimal. Normally though, rspec tests would be in a separate file.
To run a particular exercise, run the file using the rspec
command. Example:
rspec 1_hello_world.rb
Important Note: Don't attempt to modify/fix the test (Rspec) code. The bugs in these challenges are always in the logic code, not the test code. Consider the test code documentation for defining how the logic code is expected to behave.
Hi Khurram Virani, I'm a Lighthouse Labs student...I would like to suggest you a change in the "1_hello_world.rb" file.
Apparently the test code has a typo on this line:
... when 'world!' is passed i...
... when 'world' is passed i... <=CORRECTED - without the exclamation mark, so it would match what is will be tested on the next line of code:
result = hello('world') <= without exclamation mark
Because if I input 'world!' (with exclamtion mark) in the #hellow method it will return me "hello world!" when it should return me "hello word!!"(2 exclamation marks).
I hope i'm clear in the explanation, if not please let me know!