aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os
diff options
context:
space:
mode:
authorMike McQuaid2016-04-25 17:53:43 +0100
committerMike McQuaid2016-05-08 16:51:22 +0100
commitddb576b582ddc801ac702566bacbc2f231fc86af (patch)
tree797a86d0cdd540a5f0b8ad3995abe43aea17f2b9 /Library/Homebrew/os
parentc5520d0050e3a5a9050314daf643b298a5432d67 (diff)
downloadbrew-ddb576b582ddc801ac702566bacbc2f231fc86af.tar.bz2
Add support for testing generic OS.
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that neither Mac nor Linux-specific code is loaded. This allows easier testing of cross-platform code on OS X and will make it easier to port Homebrew to platforms other than OS X and Linux.
Diffstat (limited to 'Library/Homebrew/os')
-rw-r--r--Library/Homebrew/os/mac.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 73e499d40..98053f4ba 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -12,6 +12,8 @@ module OS
::MacOS = self # compatibility
+ raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]
+
# This can be compared to numerics, strings, or symbols
# using the standard Ruby Comparable methods.
def version