From ad27b21cd11a4e28f4174ebb54df357d6b6221a0 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 5 Jul 2014 13:50:54 -0500 Subject: Add popen wrapper that does not invoke the shell --- Library/Homebrew/test/test_utils.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/test_utils.rb b/Library/Homebrew/test/test_utils.rb index 4a4d96076..f9dce3a8c 100644 --- a/Library/Homebrew/test/test_utils.rb +++ b/Library/Homebrew/test/test_utils.rb @@ -5,4 +5,10 @@ class UtilTests < Homebrew::TestCase # Issue #217 put columns with new results fails. assert_silent { puts_columns [] } end + + def test_popen_read + out = Utils.popen_read("/bin/sh", "-c", "echo success", &:read).chomp + assert_equal "success", out + assert_predicate $?, :success? + end end -- cgit v1.2.3