Advertisement
ZaBlanc

Kata 8/22 Fizz Buzz Tests

Aug 22nd, 2011
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.63 KB | None | 0 0
  1. require "test/unit"
  2. require 'fizz_buzz'
  3.  
  4. class FizzBuzzTest < Test::Unit::TestCase
  5.  
  6.   def test_fizz_buzz
  7.     assert_fizz_buzz("FizzBuzz", -15)
  8.     assert_fizz_buzz("Buzz", -5)
  9.     assert_fizz_buzz("Fizz", -3)
  10.     assert_fizz_buzz("-1", -1)
  11.     assert_fizz_buzz("FizzBuzz", 0)
  12.     assert_fizz_buzz("1", 1)
  13.     assert_fizz_buzz("2", 2)
  14.     assert_fizz_buzz("Fizz", 3)
  15.     assert_fizz_buzz("4", 4)
  16.     assert_fizz_buzz("Buzz", 5)
  17.     assert_fizz_buzz("Fizz", 6)
  18.     assert_fizz_buzz("Buzz", 10)
  19.     assert_fizz_buzz("FizzBuzz", 15)
  20.   end
  21.  
  22.   def assert_fizz_buzz(exp, val)
  23.     assert_equal(exp, FizzBuzz.fizz(val))    
  24.   end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement