aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cmd
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 03:27:33 +0100
committerGitHub2017-02-25 03:27:33 +0100
commit72a436203e5b0b1147000af27f77b90a8ee1047e (patch)
tree388637311d6b889a0f313f5c6e988de5d3750da7 /Library/Homebrew/test/cmd
parent2afe338f42afef433a2cea3638fc5668c2245e8c (diff)
parentc1f70cedcb76ee53b9c7dd056a7a0cab34654fbc (diff)
downloadbrew-72a436203e5b0b1147000af27f77b90a8ee1047e.tar.bz2
Merge pull request #2143 from reitermarkus/spec-leaves
Convert `brew leaves` test to spec.
Diffstat (limited to 'Library/Homebrew/test/cmd')
-rw-r--r--Library/Homebrew/test/cmd/leaves_spec.rb23
1 files changed, 23 insertions, 0 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