Skip to content

Instantly share code, notes, and snippets.

@AntelopeSalad
Last active August 29, 2015 13:56
Show Gist options
  • Save AntelopeSalad/9021096 to your computer and use it in GitHub Desktop.
Save AntelopeSalad/9021096 to your computer and use it in GitHub Desktop.
# minitest 4.7
# running: ruby test_foo.rb results in a passing test
# running the test through sublime/rubytest or the rubymine editor results in a failing test
# fail's reason: out is empty and so is err
class TestFoo < Minitest::Unit::TestCase
def test_my_binary
out, err = capture_subprocess_io do
system '../../bin/foo version'
end
assert_match /Foo/, out
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment