Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

131336141_about_true_and_false_master #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions about_true_and_false.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ def truth_value(condition)
end

def test_true_is_treated_as_true
assert_equal __, truth_value(true)
assert_equal :true_stuff, truth_value(true)
end

def test_false_is_treated_as_false
assert_equal __, truth_value(false)
assert_equal :false_stuff, truth_value(false)
end

def test_nil_is_treated_as_false_too
assert_equal __, truth_value(nil)
assert_equal :false_stuff, 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("")
assert_equal :true_stuff, truth_value(1)
assert_equal :true_stuff, truth_value(0)
assert_equal :true_stuff, truth_value([])
assert_equal :true_stuff, truth_value({})
assert_equal :true_stuff, truth_value("Strings")
assert_equal :true_stuff, truth_value("")
end

end