Write a fonction or an object of your design called FizzBuz that takes input integer n and prints all the numbers from 1 up to n in a new line.
- if the number is divisible by 3 then print "Fizz"
- if the number is divisible by 5 then print "Buzz"
- if the number is divisible by both 3 and 5, print "FizzBuzz". Otherwise just print the number.
for example FizzBuzz(15) should print as follows:
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
- better done than perfect in a first time
- how can we test it with rspec ?
- in a second time how can we apply general good practices ?