Skip to content

Instantly share code, notes, and snippets.

@Spaceghost
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spaceghost/9009467 to your computer and use it in GitHub Desktop.
Save Spaceghost/9009467 to your computer and use it in GitHub Desktop.
gem 'minitest', '~> 4.7'
require 'minitest/autorun'
require 'open3'
class TestOutput < Minitest::Unit::TestCase
def test_that_open3_works
_,stdout,_ = Open3.popen3('rails -v')
assert_match /Rails/, stdout.read.chomp
end
end
gem 'minitest', '~> 5'
require 'minitest/autorun'
require 'open3'
puts Minitest::VERSION
class TestOutput < Minitest::Test
def test_that_open3_works
_,stdout = Open3.popen2('rails -v')
assert_match /Rails/, stdout.read.chomp
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment