aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-24 17:17:29 +0100
committerGitHub2017-02-24 17:17:29 +0100
commit1c38fd6f09e8be14a950b594c85a9f2a13b59f81 (patch)
treecb71e3806ee553910e060aae2be1d9348f237ec8 /Library
parente7fcc39c219144c12f80764e9e35d0d8e79fc561 (diff)
parente7190b9ae2ec39c98e9eb05e33edd1098f8f9085 (diff)
downloadbrew-1c38fd6f09e8be14a950b594c85a9f2a13b59f81.tar.bz2
Merge pull request #2159 from reitermarkus/spec-cleanup
Convert `brew cleanup` test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cleanup_test.rb7
-rw-r--r--Library/Homebrew/test/cmd/cleanup_spec.rb12
2 files changed, 12 insertions, 7 deletions
diff --git a/Library/Homebrew/test/cleanup_test.rb b/Library/Homebrew/test/cleanup_test.rb
index e6fc31dfe..bc7a6713c 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 000000000..9e2cf493f
--- /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