Skip to content

Instantly share code, notes, and snippets.

@avgerin0s
Forked from steveklabnik/puts_test.rb
Created May 1, 2013 22:20
Show Gist options
  • Save avgerin0s/5498853 to your computer and use it in GitHub Desktop.
Save avgerin0s/5498853 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment