Created
March 27, 2013 16:22
-
-
Save tensiondriven/5255620 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
#!/usr/bin/env ruby | |
# -*- ruby -*- | |
require File.expand_path(File.dirname(__FILE__) + '/edgecase') | |
class AboutAsserts < EdgeCase::Koan | |
# We shall contemplate truth by testing reality, via asserts. | |
def test_assert_truth | |
assert true # This should be true | |
end | |
# Enlightenment may be more easily achieved with appropriate | |
# messages. | |
def test_assert_with_message | |
assert true, "This should be true -- Please fix this" | |
end | |
# To understand reality, we must compare our expectations against | |
# reality. | |
def test_assert_equality | |
expected_value = 2 | |
actual_value = 1 + 1 | |
assert expected_value == actual_value | |
end | |
# Some ways of asserting equality are better than others. | |
def test_a_better_way_of_asserting_equality | |
expected_value = __ | |
actual_value = 1 + 1 | |
assert_equal expected_value, actual_value | |
end | |
# Sometimes we will ask you to fill in the values | |
def test_fill_in_values | |
assert_equal __, 1 + 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment