Created
September 10, 2010 01:14
-
-
Save xtoddx/572887 to your computer and use it in GitHub Desktop.
This file contains 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' | |
# | |
# The goal for this exercise is to get the test to pass while not returning the | |
# expected value. | |
# | |
# CompTest may be renamed, as may CompEntry, so don't rely on names. | |
# | |
class CompEntry | |
def add addend_a, addend_b | |
addend_a + addend_b | |
end | |
def multiply term_a, term_b | |
term_a * term_b | |
end | |
end | |
class CompTest < Test::Unit::TestCase | |
def test_add | |
assert_equal 10, CompEntry.new.add(7, 3) | |
end | |
def test_multiply | |
assert_equal 100, CompEntry.new.multiply(50, 2) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment