Timeline for Ruby FizzBuzz solution with Rspec test
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 12:40 | history | edited | CommunityBot |
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
|
|
Jul 18, 2016 at 6:28 | comment | added | Flambino | @BrooksDavis Ah, didn't know the tests were given to you. Please tell whomever you got them from that it's very, very poor code (honestly, to use this for teaching is terrible). Anyway, you too have some inconsistent whitespace in your method, though nowhere near as bad. And as also mentioned there's a bit of logic duplication, but other than that, you solved the task, which is the only real goal in FizzBuzz, so kudos. But there are many, many ways of writing it, so do check out the link at the end of my answer too. | |
Jul 18, 2016 at 5:03 | comment | added | BrooksDavis | Thank you for your answer. To be clear, the only part of this code I wrote was the second code box. The entire Rspec was given to me as the problem, I didn't write it at all so I can't answer why it was formatted the way it was. I also don't know why they wanted me to return nil, because again, I only wrote from "def fizzbuzz(int)" on down. I included the Rspec only to show what tests they wanted my code to pass. | |
Jul 18, 2016 at 0:29 | history | answered | Flambino | CC BY-SA 3.0 |