From 0c22cc45e6fe7da64f037fc2fc1556c0e967d55f Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Sun, 20 Nov 2016 14:09:16 +0900 Subject: cask: Call Tempfile#close(true) with the choices file to ensure it deleted --- Library/Homebrew/cask/test/cask/artifact/pkg_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/cask/test') diff --git a/Library/Homebrew/cask/test/cask/artifact/pkg_test.rb b/Library/Homebrew/cask/test/cask/artifact/pkg_test.rb index cb30c4a0a..6e10177d1 100644 --- a/Library/Homebrew/cask/test/cask/artifact/pkg_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/pkg_test.rb @@ -60,7 +60,9 @@ describe Hbc::Artifact::Pkg do EOS file.stubs path: Pathname.new("/tmp/choices.xml") - Tempfile.expects(:open).returns(file) + file.expects(:close).with true + Tempfile.expects(:new).returns file + Hbc::FakeSystemCommand.expects_command(["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", @cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/", "-applyChoiceChangesXML", @cask.staged_path.join("/tmp/choices.xml")]) shutup do -- cgit v1.2.3