Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_the_shovel_operator_modifies_the_original_string
- original_string = "Hello, "
- hi = original_string
- there = "World"
- hi << there
- assert_equal "Hello, World", original_string
- # THINK ABOUT IT:
- #
- # Ruby programmers tend to favor the shovel operator (<<) over the
- # plus equals operator (+=) when building up strings. Why?
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement