pyinvoke: use refute_predicate instead of !File.exist?

This commit is contained in:
ilovezfs 2017-10-06 04:16:59 -07:00
parent 3c7e219882
commit 072c4d6afd

View file

@ -35,10 +35,10 @@ class Pyinvoke < Formula
(testpath/"foo"/"bar").mkpath
(testpath/"baz").mkpath
system bin/"invoke", "clean"
assert !File.exist?(testpath/"foo"), "\"pyinvoke clean\" should have deleted \"foo\""
refute_predicate testpath/"foo", :exist?, "\"pyinvoke clean\" should have deleted \"foo\""
assert_predicate testpath/"baz", :exist?, "pyinvoke should have left \"baz\""
system bin/"invoke", "clean", "--extra=baz"
assert !File.exist?(testpath/"foo"), "\"pyinvoke clean-extra\" should have still deleted \"foo\""
assert !File.exist?(testpath/"baz"), "pyinvoke clean-extra should have deleted \"baz\""
refute_predicate testpath/"foo", :exist?, "\"pyinvoke clean-extra\" should have still deleted \"foo\""
refute_predicate testpath/"baz", :exist?, "pyinvoke clean-extra should have deleted \"baz\""
end
end