Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello,
- I have this script
- def say_hello(name, city, state)
- name2=""
- name.each do |n|
- name2 = name2 + " " + n.to_s
- end
- return "Hello, #{name2}! Welcome to #{city}, #{state}!"
- end
- When I make my test this way :
- Test.expect(say_hello(['John', 'Smith'], 'Phoenix', 'Arizona'),"Hello, John Smith! Welcome to Phoenix, Arizona!")
- Test.expect(say_hello(['Franklin','Delano','Roosevelt'], 'Chicago', 'Illinois'),'Hello, Franklin Delano Roosevelt! Welcome to Chicago, Illinois!')
- Test.expect(say_hello(['Wallace','Russel','Osbourne'],'Albany','New York'),'Hello, Wallace Russel Osbourne! Welcome to Albany, New York!')
- Every test is a success.
- When I do this :
- Test.expect(say_hello(['John', 'Smith'], 'Phoenix', 'Arizona')=="Hello, John Smith! Welcome to Phoenix, Arizona!")
- Test.expect(say_hello(['Franklin','Delano','Roosevelt'], 'Chicago', 'Illinois') =='Hello, Franklin Delano Roosevelt! Welcome to Chicago, Illinois!')
- Test.expect(say_hello(['Wallace','Russel','Osbourne'],'Albany','New York')=='Hello, Wallace Russel Osbourne! Welcome to Albany, New York!')
- All test fail.
- Can someone explain this to me.
- Roelof
Advertisement
Add Comment
Please, Sign In to add comment