Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe PrintingQuotes do
- it "asks for the quote" do
- output = StringIO.new()
- # assigning output to StringIO and creating an instance of StringIO
- -> creating a "fake" console where we will pass strings
- described_class.ask_question(output,"What is the quote?")
- # when we call the method ask_question and its argument "What is the quote?"
- on PrintingQuotes, the console should print "What is the quote?"
- expect(output.string).to eq("What is the quote?\n")
- # we check that the message we are expecting to see
- printed in the console is "What is the quote?"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement