-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathruby_koans1.rb
More file actions
37 lines (29 loc) · 929 Bytes
/
ruby_koans1.rb
File metadata and controls
37 lines (29 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class AboutAsserts
# 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 = __
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 = 2
actual_value = 1 + 1
assert_equal expected_value, actual_value
end
# Sometimes we will ask you to fill in the values
def test_fill_i_values
assert_equal 2, 1 + 1
end
end
#Assets work logically & will show true as they require true