Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "test/unit"
- require 'fizz_buzz'
- class FizzBuzzTest < Test::Unit::TestCase
- def test_fizz_buzz
- assert_fizz_buzz("FizzBuzz", -15)
- assert_fizz_buzz("Buzz", -5)
- assert_fizz_buzz("Fizz", -3)
- assert_fizz_buzz("-1", -1)
- assert_fizz_buzz("FizzBuzz", 0)
- assert_fizz_buzz("1", 1)
- assert_fizz_buzz("2", 2)
- assert_fizz_buzz("Fizz", 3)
- assert_fizz_buzz("4", 4)
- assert_fizz_buzz("Buzz", 5)
- assert_fizz_buzz("Fizz", 6)
- assert_fizz_buzz("Buzz", 10)
- assert_fizz_buzz("FizzBuzz", 15)
- end
- def assert_fizz_buzz(exp, val)
- assert_equal(exp, FizzBuzz.fizz(val))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement