Skip to content

Instantly share code, notes, and snippets.

@alexandreaquiles
Created October 5, 2010 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandreaquiles/610827 to your computer and use it in GitHub Desktop.
Save alexandreaquiles/610827 to your computer and use it in GitHub Desktop.
def test_fizzbuzz_de_1_a_20
sequence = []
1.upto(20) do |n|
fizzbuzz = FizzBuzz.new(n)
sequence.push(fizzbuzz.run)
end
assert_equal '1,2,fizz,4,buzz,fizz,7,8,fizz,buzz,11,fizz,13,14,fizzbuzz,16,17,fizz,19,buzz', sequence.join(",")
end
@alexandreaquiles
Copy link
Author

Last test that was lacking in the codingdojo we did last saturday. I don't like the idea of passing the number as an argument to the constructor. But the actual implementation is quite readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment