mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
@@ -30,22 +30,20 @@ class AboutObjects < EdgeCase::Koan
|
||||
assert_equal __(true), obj.object_id != another_obj.object_id
|
||||
end
|
||||
|
||||
not_in_ruby_version('rbx') do
|
||||
def test_some_system_objects_always_have_the_same_id
|
||||
assert_equal __(0), false.object_id
|
||||
assert_equal __(2), true.object_id
|
||||
assert_equal __(4), nil.object_id
|
||||
end
|
||||
def test_some_system_objects_always_have_the_same_id
|
||||
assert_equal __(0), false.object_id
|
||||
assert_equal __(2), true.object_id
|
||||
assert_equal __(4), nil.object_id
|
||||
end
|
||||
|
||||
def test_small_integers_have_fixed_ids
|
||||
assert_equal __(1), 0.object_id
|
||||
assert_equal __(3), 1.object_id
|
||||
assert_equal __(5), 2.object_id
|
||||
assert_equal __(201), 100.object_id
|
||||
def test_small_integers_have_fixed_ids
|
||||
assert_equal __(1), 0.object_id
|
||||
assert_equal __(3), 1.object_id
|
||||
assert_equal __(5), 2.object_id
|
||||
assert_equal __(201), 100.object_id
|
||||
|
||||
# THINK ABOUT IT:
|
||||
# What pattern do the object IDs for small integers follow?
|
||||
end
|
||||
# THINK ABOUT IT:
|
||||
# What pattern do the object IDs for small integers follow?
|
||||
end
|
||||
|
||||
def test_clone_creates_a_different_object
|
||||
|
||||
Reference in New Issue
Block a user