Merge pull request #2159 from reitermarkus/spec-cleanup

Convert `brew cleanup` test to spec.
This commit is contained in:
Markus Reiter 2017-02-24 17:17:29 +01:00 committed by GitHub
commit 1c38fd6f09
2 changed files with 12 additions and 7 deletions

View File

@ -5,13 +5,6 @@ require "fileutils"
require "pathname" require "pathname"
require "testing_env" require "testing_env"
class IntegrationCommandTestCleanup < IntegrationCommandTestCase
def test_cleanup
(HOMEBREW_CACHE/"test").write "test"
assert_match "#{HOMEBREW_CACHE}/test", cmd("cleanup", "--prune=all")
end
end
class CleanupTests < Homebrew::TestCase class CleanupTests < Homebrew::TestCase
def setup def setup
super super

View File

@ -0,0 +1,12 @@
describe "brew cleanup", :integration_test do
describe "--prune=all" do
it "removes all files in Homebrew's cache" do
(HOMEBREW_CACHE/"test").write "test"
expect { brew "cleanup", "--prune=all" }
.to output(%r{#{Regexp.escape(HOMEBREW_CACHE)}/test}).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
end
end