moving to a new repo

This commit is contained in:
Joe O'Brien
2009-01-26 11:56:38 -05:00
parent 55fd4afa0f
commit 4e78262965
37 changed files with 2693 additions and 0 deletions

33
about_true_and_false.rb Normal file
View File

@@ -0,0 +1,33 @@
require 'edgecase'
class AboutTrueAndFalse < EdgeCase::Koan
def truth_value(condition)
if condition
:true_stuff
else
:false_stuff
end
end
def test_true_is_treated_as_true
assert_equal __, truth_value(true)
end
def test_false_is_treated_as_false
assert_equal __, truth_value(false)
end
def test_nil_is_treated_as_false_too
assert_equal __, truth_value(nil)
end
def test_everything_else_is_treated_as_true
assert_equal __, truth_value(1)
assert_equal __, truth_value(0)
assert_equal __, truth_value([])
assert_equal __, truth_value({})
assert_equal __, truth_value("Strings")
assert_equal __, truth_value("")
end
end