aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/test
diff options
context:
space:
mode:
authorKaito Udagawa2016-11-21 04:13:29 +0900
committerKaito Udagawa2016-11-21 04:13:29 +0900
commitdf635c8259dffca891424352765088a3b88a87d2 (patch)
treea07dcf3683057ed8256a94677b736765e86b722d /Library/Homebrew/cask/test
parent0c22cc45e6fe7da64f037fc2fc1556c0e967d55f (diff)
downloadbrew-df635c8259dffca891424352765088a3b88a87d2.tar.bz2
cask: compact the code
Diffstat (limited to 'Library/Homebrew/cask/test')
-rw-r--r--Library/Homebrew/cask/test/cask/artifact/pkg_test.rb5
1 files changed, 3 insertions, 2 deletions
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
</plist>
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")])