diff options
| author | Markus Reiter | 2017-02-25 07:38:09 +0100 |
|---|---|---|
| committer | GitHub | 2017-02-25 07:38:09 +0100 |
| commit | 93e2cb31afa1671c36023d119d9a539373b4be43 (patch) | |
| tree | 0ceb1fb2aafe4b3dc0a608ac5a7954f083037ec9 /Library | |
| parent | 069cf2198c8617d3bae74238a04925fb8b542f8a (diff) | |
| parent | ed72e02bbadaf2164bf359bf7e8eac9ffcbd0b9e (diff) | |
| download | brew-93e2cb31afa1671c36023d119d9a539373b4be43.tar.bz2 | |
Merge pull request #2095 from joshliu/spec-deps
Convert deps test to spec
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/deps_spec.rb | 31 | ||||
| -rw-r--r-- | Library/Homebrew/test/deps_test.rb | 16 |
2 files changed, 31 insertions, 16 deletions
diff --git a/Library/Homebrew/test/deps_spec.rb b/Library/Homebrew/test/deps_spec.rb new file mode 100644 index 000000000..4c892c93d --- /dev/null +++ b/Library/Homebrew/test/deps_spec.rb @@ -0,0 +1,31 @@ +describe "brew deps", :integration_test do + before(:each) 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 + end + + it "outputs no dependencies for a Formula that has no dependencies" do + expect { brew "deps", "foo" } + .to be_a_success + .and not_to_output.to_stdout + .and not_to_output.to_stderr + end + + it "outputs a dependency for a Formula that has one dependency" do + expect { brew "deps", "bar" } + .to be_a_success + .and output("foo\n").to_stdout + .and not_to_output.to_stderr + end + + it "outputs all of a Formula's dependencies and their dependencies on separate lines" do + expect { brew "deps", "baz" } + .to be_a_success + .and output("bar\nfoo\n").to_stdout + .and not_to_output.to_stderr + end +end diff --git a/Library/Homebrew/test/deps_test.rb b/Library/Homebrew/test/deps_test.rb deleted file mode 100644 index 01639857c..000000000 --- a/Library/Homebrew/test/deps_test.rb +++ /dev/null @@ -1,16 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestDeps < IntegrationCommandTestCase - def test_deps - 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 - - assert_equal "", cmd("deps", "foo") - assert_equal "foo", cmd("deps", "bar") - assert_equal "bar\nfoo", cmd("deps", "baz") - end -end |
