Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. describe PrintingQuotes do
  2.  
  3. it "asks for the quote" do
  4. output = StringIO.new()
  5. # assigning output to StringIO and creating an instance of StringIO
  6. -> creating a "fake" console where we will pass strings
  7.  
  8. described_class.ask_question(output,"What is the quote?")
  9. # when we call the method ask_question and its argument "What is the quote?"
  10. on PrintingQuotes, the console should print "What is the quote?"
  11.  
  12. expect(output.string).to eq("What is the quote?\n")
  13. # we check that the message we are expecting to see
  14. printed in the console is "What is the quote?"
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement