Created
April 10, 2012 15:50
-
-
Save remear/2352335 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test/unit" | |
class TestFizzBuzz < Test::Unit::TestCase | |
def fizzbuzz(x) | |
"#{'Fizz' if x % 3 == 0}#{'Buzz' if x % 5 == 0}" | |
end | |
def test_equal | |
assert_equal fizzbuzz(3), "Fizz" | |
assert_equal fizzbuzz(50), "Buzz" | |
assert_equal fizzbuzz(15), "FizzBuzz" | |
assert_equal fizzbuzz(5175), "FizzBuzz" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment