aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-23 06:03:40 +0100
committerMarkus Reiter2017-02-23 21:22:16 +0100
commitc1f70cedcb76ee53b9c7dd056a7a0cab34654fbc (patch)
tree832d2b76d945b68d44411abd4a1a687c035125a7 /Library
parentc7121f6be50e44784e3e29114617c29715bd9c0f (diff)
downloadbrew-c1f70cedcb76ee53b9c7dd056a7a0cab34654fbc.tar.bz2
Convert `brew leaves` test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cmd/leaves_spec.rb23
-rw-r--r--Library/Homebrew/test/leaves_test.rb15
2 files changed, 23 insertions, 15 deletions
diff --git a/Library/Homebrew/test/cmd/leaves_spec.rb b/Library/Homebrew/test/cmd/leaves_spec.rb
new file mode 100644
index 000000000..cd93d7e3d
--- /dev/null
+++ b/Library/Homebrew/test/cmd/leaves_spec.rb
@@ -0,0 +1,23 @@
+describe "brew leaves", :integration_test do
+ it "prints all Formulae that are not dependencies of other Formulae" do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+
+ expect { brew "leaves" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ (HOMEBREW_CELLAR/"foo/0.1/somedir").mkpath
+ expect { brew "leaves" }
+ .to output("foo\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ (HOMEBREW_CELLAR/"bar/0.1/somedir").mkpath
+ expect { brew "leaves" }
+ .to output("bar\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/leaves_test.rb b/Library/Homebrew/test/leaves_test.rb
deleted file mode 100644
index f73fba1ea..000000000
--- a/Library/Homebrew/test/leaves_test.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestLeaves < IntegrationCommandTestCase
- def test_leaves
- setup_test_formula "foo"
- setup_test_formula "bar"
- assert_equal "", cmd("leaves")
-
- (HOMEBREW_CELLAR/"foo/0.1/somedir").mkpath
- assert_equal "foo", cmd("leaves")
-
- (HOMEBREW_CELLAR/"bar/0.1/somedir").mkpath
- assert_equal "bar", cmd("leaves")
- end
-end