---
title: "Discussion on \"Capturing multi-line console output in Ruby's RSpec testing interface\" | Hashnode"
description: "Discussion on \"Capturing multi-line console output in Ruby's RSpec testing interface\". How do you capture multiple lines of console output in Ruby? Here is one way to do it using $stdout = StringIO.new"
url: "https://hashnode.com/posts/capturing-multi-line-console-output-in-rubys-rspec-testing-interface/6339d920882336647782e987"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Capturing multi-line console output in Ruby's RSpec testing interface](https://blog.petefowler.dev/capturing-multi-line-console-output-in-rubys-rspec-testing-interface?utm_source=hashnode&utm_medium=feed)

How do you capture multiple lines of console output in Ruby? Here is one way to do it using $stdout = StringIO.new

Oct 2, 2022 · 3 min read · blog.petefowler.dev  
Read the article

-   [#ruby](https://hashnode.com/tag/ruby)
-   [#rspec](https://hashnode.com/tag/rspec)

## Written by

[Pete Fowler](https://hashnode.com/@pfowler)

@pfowler · Denver, CO

  
[View profile](https://hashnode.com/@pfowler)

Full Stack Software Engineer | JavaScript, TypeScript, React, C# / .NET, Amazon Web Services (AWS)

Full stack software engineer building a financial data integration SaaS product. Led a complete rebuild of the team’s web app using JavaScript, TypeScript, React, C#/.NET, EntityFramework Core and SQL, with testing in Jest, React Testing Library, xUnit, and Moq. Utilized AWS services including MySQL RDS, EC2, ECS with Docker, S3, Lambda, and EventBridge. Passionate about continuous improvement, clean code, and best practices (where they exist). Dedicated rock climber and runner based in Colorado. Names variables like a first born child.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
