Skip to content

Commit 9fd48be

Browse files
authored
Merge pull request #203634 from Homebrew/msitools-test
msitools: use shell_output and assert_path_exists in test
2 parents 3d7359a + 4dd42ea commit 9fd48be

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Formula/m/msitools.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def install
5050

5151
test do
5252
# wixl-heat: make an xml fragment
53-
assert_match "<Fragment>", pipe_output("#{bin}/wixl-heat --prefix test")
53+
assert_match "<Fragment>", pipe_output("#{bin}/wixl-heat --prefix test", nil, 0)
5454

5555
# wixl: build two installers
5656
1.upto(2) do |i|
@@ -80,18 +80,16 @@ def install
8080
</Wix>
8181
XML
8282
system bin/"wixl", "-o", "installer#{i}.msi", "installer#{i}.wxs"
83-
assert_predicate testpath/"installer#{i}.msi", :exist?
83+
assert_path_exists testpath/"installer#{i}.msi"
8484
end
8585

8686
# msidiff: diff two installers
87-
lines = `#{bin}/msidiff --list installer1.msi installer2.msi 2>/dev/null`.split("\n")
88-
assert_equal 0, $CHILD_STATUS.exitstatus
87+
lines = shell_output("#{bin}/msidiff --list installer1.msi installer2.msi 2>/dev/null").split("\n")
8988
assert_equal "-Program Files/test/test1.txt", lines[-2]
9089
assert_equal "+Program Files/test/test2.txt", lines[-1]
9190

9291
# msiinfo: show info for an installer
93-
out = `#{bin}/msiinfo suminfo installer1.msi`
94-
assert_equal 0, $CHILD_STATUS.exitstatus
92+
out = shell_output("#{bin}/msiinfo suminfo installer1.msi")
9593
assert_match(/Author: BigCo/, out)
9694

9795
# msiextract: extract files from an installer
@@ -103,7 +101,7 @@ def install
103101
# msidump: dump tables from an installer
104102
mkdir "idt"
105103
system bin/"msidump", "--directory", "idt", "installer1.msi"
106-
assert_predicate testpath/"idt/File.idt", :exist?
104+
assert_path_exists testpath/"idt/File.idt"
107105

108106
# msibuild: replace a table in an installer
109107
system bin/"msibuild", "installer1.msi", "-i", "idt/File.idt"

0 commit comments

Comments
 (0)