diff --git a/Library/Homebrew/test/cleanup_test.rb b/Library/Homebrew/test/cleanup_test.rb index e6fc31dfe2..bc7a6713c6 100644 --- a/Library/Homebrew/test/cleanup_test.rb +++ b/Library/Homebrew/test/cleanup_test.rb @@ -5,13 +5,6 @@ require "fileutils" require "pathname" 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 def setup super diff --git a/Library/Homebrew/test/cmd/cleanup_spec.rb b/Library/Homebrew/test/cmd/cleanup_spec.rb new file mode 100644 index 0000000000..9e2cf493f8 --- /dev/null +++ b/Library/Homebrew/test/cmd/cleanup_spec.rb @@ -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