aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-23 06:00:11 +0100
committerMarkus Reiter2017-02-23 21:36:39 +0100
commite7190b9ae2ec39c98e9eb05e33edd1098f8f9085 (patch)
tree7aedb2c41ed6380d268de241b4c0826a7f81e6fc /Library/Homebrew/test
parentc7121f6be50e44784e3e29114617c29715bd9c0f (diff)
downloadbrew-e7190b9ae2ec39c98e9eb05e33edd1098f8f9085.tar.bz2
Convert `brew cleanup` test to spec.
Diffstat (limited to 'Library/Homebrew/test')
-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