diff options
| author | Markus Reiter | 2016-10-24 22:53:25 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-11-16 23:52:38 +0100 |
| commit | 4db1317f38f5a55574854e7bf1dfe4379e807b4f (patch) | |
| tree | 5c59b2334ebae4fa235449dac8589858ac8afb8f /Library/Homebrew/test/testing_env.rb | |
| parent | 4efdbbde06bc8785870315f7a334694e59b33528 (diff) | |
| download | brew-4db1317f38f5a55574854e7bf1dfe4379e807b4f.tar.bz2 | |
Move all remaining fixtures to `test/support/fixtures`.
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
| -rw-r--r-- | Library/Homebrew/test/testing_env.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb index d441b4f1c..76b943164 100644 --- a/Library/Homebrew/test/testing_env.rb +++ b/Library/Homebrew/test/testing_env.rb @@ -1,5 +1,5 @@ $:.unshift File.expand_path("../..", __FILE__) -$:.unshift File.expand_path("../lib", __FILE__) +$:.unshift File.expand_path("../support/lib", __FILE__) require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"] require "global" @@ -9,9 +9,6 @@ require "formulary" (HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-core/Formula").mkpath %w[cache formula_cache locks cellar logs temp].each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath } -# Test fixtures and files can be found relative to this path -TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__)) - begin require "rubygems" require "minitest/autorun" @@ -43,7 +40,9 @@ module Homebrew module FSLeakLogger def self.included(klass) require "find" - @@log = File.open(HOMEBREW_LIBRARY_PATH/"tmp/fs_leak.log", "w") + logdir = HOMEBREW_LIBRARY_PATH.join("tmp") + logdir.mkdir unless logdir.directory? + @@log = File.open(logdir.join("fs_leak.log"), "w") klass.make_my_diffs_pretty! end @@ -63,8 +62,8 @@ module Homebrew end class TestCase < ::Minitest::Test - require "test/helper/env" - require "test/helper/shutup" + require "test/support/helper/env" + require "test/support/helper/shutup" include Test::Helper::Env include Test::Helper::Shutup @@ -107,11 +106,11 @@ module Homebrew end def dylib_path(name) - Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.dylib") + Pathname.new("#{TEST_FIXTURE_DIR}/mach/#{name}.dylib") end def bundle_path(name) - Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.bundle") + Pathname.new("#{TEST_FIXTURE_DIR}/mach/#{name}.bundle") end # Use a stubbed {Formulary::FormulaLoader} to make a given formula be found |
