From df635c8259dffca891424352765088a3b88a87d2 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Mon, 21 Nov 2016 04:13:29 +0900 Subject: cask: compact the code --- Library/Homebrew/cask/test/cask/artifact/pkg_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (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 6e10177d1..3ed427763 100644 --- a/Library/Homebrew/cask/test/cask/artifact/pkg_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/pkg_test.rb @@ -60,8 +60,9 @@ describe Hbc::Artifact::Pkg do EOS file.stubs path: Pathname.new("/tmp/choices.xml") - file.expects(:close).with true - Tempfile.expects(:new).returns file + file.expects(:close) + file.expects(:unlink) + Tempfile.expects(:open).yields 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")]) -- cgit v1.2.3