words = ["Now", "is", "the", "time"]
assert_equal __, words.join(" ")
end
+
+ def test_strings_are_not_unique_objects
+ a = "a string"
+ b = "a string"
+
+ assert_equal __, a == b
+ assert_equal __, a.object_id == b.object_id
+ end
end
symbol1 = :a_symbol
symbol2 = :a_symbol
- assert symbol1.equal?(__)
- assert_equal __, symbol2.object_id
+ assert_equal __, symbol1 == symbol2
+ assert_equal __, symbol1.object_id == symbol2.object_id
end
def test_method_names_become_symbols
words = ["Now", "is", "the", "time"]
assert_equal __("Now is the time"), words.join(" ")
end
+
+ def test_strings_are_not_unique_objects
+ a = "a string"
+ b = "a string"
+
+ assert_equal __(true), a == b
+ assert_equal __(false), a.object_id == b.object_id
+ end
end
symbol1 = :a_symbol
symbol2 = :a_symbol
- assert symbol1.equal?(__(symbol2))
- assert_equal __(symbol1.object_id), symbol2.object_id
+ assert_equal __(true), symbol1 == symbol2
+ assert_equal __(true), symbol1.object_id == symbol2.object_id
end
def test_method_names_become_symbols