Skip to content

Commit 561965b

Browse files
committed
Use alt example in about_open_classes
Integer#even? ended up in a more modern version of ruby (yay progress!). This updates the koan to use a different, more outlandish example, that I don’t think will end up in Ruby — and that I know Jim would appreciate <3
1 parent 250aaa4 commit 561965b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/about_open_classes.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ def test_after_reopening_dogs_can_both_wag_and_bark
3030
# ------------------------------------------------------------------
3131

3232
class ::Integer
33-
def even?
34-
(self % 2) == 0
33+
def answer_to_life_universe_and_everything?
34+
self == 42
3535
end
3636
end
3737

3838
def test_even_existing_built_in_classes_can_be_reopened
39-
assert_equal __(false), 1.even?
40-
assert_equal __(true), 2.even?
39+
assert_equal __(false), 1.answer_to_life_universe_and_everything?
40+
assert_equal __(true), 42.answer_to_life_universe_and_everything?
4141
end
4242

4343
# NOTE: To understand why we need the :: before Integer, you need to

0 commit comments

Comments
 (0)