Delete with_environment from cask tests.
This commit is contained in:
parent
7d131de57d
commit
b7dc56a8aa
@ -39,17 +39,17 @@ describe Hbc::CLI do
|
||||
end
|
||||
|
||||
it "respects the env variable when choosing what appdir to create" do
|
||||
with_environment "HOMEBREW_CASK_OPTS" => "--appdir=/custom/appdir" do
|
||||
expect(Hbc).to receive(:appdir=).with(Pathname("/custom/appdir"))
|
||||
described_class.process("noop")
|
||||
end
|
||||
allow(ENV).to receive(:[])
|
||||
allow(ENV).to receive(:[]).with("HOMEBREW_CASK_OPTS").and_return("--appdir=/custom/appdir")
|
||||
expect(Hbc).to receive(:appdir=).with(Pathname.new("/custom/appdir"))
|
||||
described_class.process("noop")
|
||||
end
|
||||
|
||||
it "respects the env variable when choosing a non-default Caskroom location" do
|
||||
with_environment "HOMEBREW_CASK_OPTS" => "--caskroom=/custom/caskdir" do
|
||||
expect(Hbc).to receive(:caskroom=).with(Pathname("/custom/caskdir"))
|
||||
described_class.process("noop")
|
||||
end
|
||||
allow(ENV).to receive(:[])
|
||||
allow(ENV).to receive(:[]).with("HOMEBREW_CASK_OPTS").and_return("--caskroom=/custom/caskdir")
|
||||
expect(Hbc).to receive(:caskroom=).with(Pathname.new("/custom/caskdir"))
|
||||
described_class.process("noop")
|
||||
end
|
||||
|
||||
it "exits with a status of 1 when something goes wrong" do
|
||||
|
||||
@ -69,7 +69,11 @@ describe Hbc::DSL do
|
||||
end
|
||||
|
||||
it "may use deprecated DSL version hash syntax" do
|
||||
with_environment "HOMEBREW_DEVELOPER" => nil do
|
||||
stub = proc do |arg|
|
||||
arg == "HOMEBREW_DEVELOPER" ? nil : ENV[arg]
|
||||
end
|
||||
|
||||
ENV.stub :[], stub do
|
||||
shutup do
|
||||
test_cask = Hbc.load("with-dsl-version")
|
||||
test_cask.token.must_equal "with-dsl-version"
|
||||
|
||||
@ -13,9 +13,7 @@ require "global"
|
||||
# add Homebrew-Cask to load path
|
||||
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
||||
|
||||
require "test/support/helper/env"
|
||||
require "test/support/helper/shutup"
|
||||
include Test::Helper::Env
|
||||
include Test::Helper::Shutup
|
||||
|
||||
def sudo(*args)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user