1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
From f04ffb614d7e76997039f42d4406494e25d3390a Mon Sep 17 00:00:00 2001 From: Tim D. Smith Date: Wed, 29 Jun 2016 10:33:08 -0700 Subject: Move with_environment to testing_env --- Library/Homebrew/test/test_cmd_testbot.rb | 10 ---------- Library/Homebrew/test/testing_env.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/test/test_cmd_testbot.rb b/Library/Homebrew/test/test_cmd_testbot.rb index 77a9b3df5..40dd22f34 100644 --- a/Library/Homebrew/test/test_cmd_testbot.rb +++ b/Library/Homebrew/test/test_cmd_testbot.rb @@ -2,16 +2,6 @@ require "testing_env" require "dev-cmd/test-bot" class TestbotCommandTests < Homebrew::TestCase - def with_environment(partial_env) - old = ENV.to_hash - ENV.update partial_env - begin - yield - ensure - ENV.replace old - end - end - def test_resolve_test_tap tap = Homebrew.resolve_test_tap assert_nil tap, "Should return nil if no tap slug provided" diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb index 6be622cc5..214aa9789 100644 --- a/Library/Homebrew/test/testing_env.rb +++ b/Library/Homebrew/test/testing_env.rb @@ -120,5 +120,15 @@ module Homebrew def bundle_path(name) Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.bundle") end + + def with_environment(partial_env) + old = ENV.to_hash + ENV.update partial_env + begin + yield + ensure + ENV.replace old + end + end end end -- cgit v1.2.3 href='/fork/angular.js/refs/?id=c648fee5c2c46cbd2ea8b5bd4cec8005f182db1c'>refslogtreecommitdiffstats