aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cmd
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-23 06:05:56 +0100
committerMarkus Reiter2017-02-23 21:07:41 +0100
commite7b3cfd51633329b67928f81c06b68ef98bfba87 (patch)
tree53d706a9d556bbde0ee3b8601cac49cce6e07d91 /Library/Homebrew/test/cmd
parentc7121f6be50e44784e3e29114617c29715bd9c0f (diff)
downloadbrew-e7b3cfd51633329b67928f81c06b68ef98bfba87.tar.bz2
Convert `brew uses` test to spec.
Diffstat (limited to 'Library/Homebrew/test/cmd')
-rw-r--r--Library/Homebrew/test/cmd/uses_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb
new file mode 100644
index 000000000..2a6f48cb7
--- /dev/null
+++ b/Library/Homebrew/test/cmd/uses_spec.rb
@@ -0,0 +1,25 @@
+describe "brew uses", :integration_test do
+ it "prints the Formulae a given Formula is used by" do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+ setup_test_formula "baz", <<-EOS.undent
+ url "https://example.com/baz-1.0"
+ depends_on "bar"
+ EOS
+
+ expect { brew "uses", "baz" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ expect { brew "uses", "bar" }
+ .to output("baz\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "uses", "--recursive", "foo" }
+ .to output(/(bar\nbaz|baz\nbar)/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end