Please consider the following code. I got it to work but by trial and error. I don't really understand why the commands are where they are. I only understand the last - that shows the where the code ends. Can somebody explain the other s please.
# Write a method that takes in a string. Return the longest word in
# the string. You may assume that the string contains only letters and
# You may use the String `split` method to aid you in your quest.
end #THIS IS THE PART WHERE I DON'T GET
# These are tests to check that your code is working. After writing
# your solution, they should all print true.
puts("\nTests for #longest_word")
'longest_word("short longest") == "longest": ' +
(longest_word('short longest') == 'longest').to_s
'longest_word("one") == "one": ' +
(longest_word('one') == 'one').to_s
'longest_word("abc def abcde") == "abcde": ' +
(longest_word('abc def abcde') == 'abcde').to_s