aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMike McQuaid2016-08-14 17:33:05 +0100
committerMike McQuaid2016-08-15 08:33:58 +0100
commitfed96385acc2ee10909870997950f2e48a86026f (patch)
tree12b3c3f10e5c81febac3e1c9a529cb2411024d12 /Library/Homebrew/test
parentb630ab3d1717c1a436610a1542c71ebaadcf3bc0 (diff)
downloadbrew-fed96385acc2ee10909870997950f2e48a86026f.tar.bz2
sandbox: add test? method.
Simplify checking if we’re going to sandbox a test with `Sandbox.test?`.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_sandbox.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_sandbox.rb b/Library/Homebrew/test/test_sandbox.rb
index dc907d428..de60551d1 100644
--- a/Library/Homebrew/test/test_sandbox.rb
+++ b/Library/Homebrew/test/test_sandbox.rb
@@ -13,6 +13,12 @@ class SandboxTest < Homebrew::TestCase
@dir.rmtree
end
+ def test_test?
+ ARGV.stubs(:no_sandbox?).returns false
+ assert Sandbox.test?,
+ "Tests should be sandboxed unless --no-sandbox was passed."
+ end
+
def test_allow_write
@sandbox.allow_write @file
@sandbox.exec "touch", @file