! # … all the code …! ! ! ! ! ! ! ! ! ! ! self! end! end! "123 Main St. Arlington" ! "123 Main St. VA 22222" "123 Main St. Arlington, VA 22222” ! "Arlington, VA" RULE 1
! # … all the code …! ! ! ! ! ! ! ! ! ! ! self! end! end! "123 Main St. Arlington" ! "123 Main St. VA 22222" "123 Main St. Arlington, VA 22222” ! "Arlington, VA"
= nil if province_and_postal_code.empty?! ! city_province_postal_code = [city, province_and_postal_code].compact.join(', ')! city_province_postal_code = nil if city_province_postal_code.empty?! ! [street, city_province_postal_code].compact.join("\n")! end! end “123 Main St. Arlington” “123 Main St. VA 22222" “123 Main St. Arlington, VA 22222” “Arlington, VA"
person.friend = friend! person! }! before do! Table.clear! end! it 'forwards a message to another object' do! assert_equal [], Table.contents! person.make_me_a_sandwich! assert_includes Table.contents, "a sandwich!"! end! end
person.friend = friend! person! }! before do! Table.clear! end! it 'forwards a message to another object' do! assert_equal [], Table.contents! person.friend.make_me_a_sandwich! assert_includes Table.contents, "a sandwich!"! end! ! ! !
person.friend = friend! person! }! before do! Table.clear! end! it 'forwards a message to another object' do! assert_equal [], Table.contents! person.make_me_a_sandwich! assert_includes Table.contents, "a sandwich!"! end! ! it 'returns the original receiver' do! assert_equal person, person.make_me_a_sandwich! end!