Created
October 15, 2011 01:46
-
-
Save steveburkett/1288863 to your computer and use it in GitHub Desktop.
no test or bad test
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
def itoa(val) | |
val.to_s | |
end | |
require 'test/unit' | |
class TestItoA < Test::Unit::TestCase | |
def bad_test_simple_val | |
s = itoa 10 | |
end | |
end | |
1 tests, 0 assertions, 0 failures, 0 errors | |
Next, change the code (oops!) | |
def itoa(val) | |
val.to_sss | |
end | |
1) Error:test_simple_val(TestItoA): | |
NoMethodError: undefined method `to_sss' for 10:Fixnum | |
/Users/steveburkett/workspace/meta/avg.rb:2:in `itoa' | |
/Users/steveburkett/workspace/meta/avg.rb:9:in `bad_test_simple_val' | |
1 tests, 0 assertions, 0 failures, 1 errors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment