Move with_environment to testing_env
This commit is contained in:
parent
4e927d9ce8
commit
f04ffb614d
@ -2,16 +2,6 @@ require "testing_env"
|
|||||||
require "dev-cmd/test-bot"
|
require "dev-cmd/test-bot"
|
||||||
|
|
||||||
class TestbotCommandTests < Homebrew::TestCase
|
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
|
def test_resolve_test_tap
|
||||||
tap = Homebrew.resolve_test_tap
|
tap = Homebrew.resolve_test_tap
|
||||||
assert_nil tap, "Should return nil if no tap slug provided"
|
assert_nil tap, "Should return nil if no tap slug provided"
|
||||||
|
|||||||
@ -120,5 +120,15 @@ module Homebrew
|
|||||||
def bundle_path(name)
|
def bundle_path(name)
|
||||||
Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.bundle")
|
Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.bundle")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def with_environment(partial_env)
|
||||||
|
old = ENV.to_hash
|
||||||
|
ENV.update partial_env
|
||||||
|
begin
|
||||||
|
yield
|
||||||
|
ensure
|
||||||
|
ENV.replace old
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user