Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created May 1, 2013 22:15
Show Gist options
  • Save steveklabnik/5498834 to your computer and use it in GitHub Desktop.
Save steveklabnik/5498834 to your computer and use it in GitHub Desktop.
testing puts in minitest
require 'minitest/autorun'
class CaptureIoTest < MiniTest::Unit::TestCase
def test_puts
out, err = capture_io do
puts "hey"
end
assert_equal "hey\n", out
end
end
@avgerin0s
Copy link

👍 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment