aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cmd
diff options
context:
space:
mode:
authorGautham Goli2017-10-12 00:29:19 +0530
committerGautham Goli2017-10-13 19:50:46 +0530
commit7fa51f71f1a8a21b905bafc1fb4106f0222d654f (patch)
tree098d2477a8262a5770310fed4693da31c4392e1c /Library/Homebrew/test/cmd
parentafdd0e2437426ec85ff86e5b7562d3a6a69ba3e5 (diff)
parent56458f03fcc68ef6d8ee3ee4a7c1d16021aa5800 (diff)
downloadbrew-7fa51f71f1a8a21b905bafc1fb4106f0222d654f.tar.bz2
Merge branch 'master' into audit_line_rubocop_part_4_rebase_attempt_1
Diffstat (limited to 'Library/Homebrew/test/cmd')
-rw-r--r--Library/Homebrew/test/cmd/commands_spec.rb2
-rw-r--r--Library/Homebrew/test/cmd/home_spec.rb6
-rw-r--r--Library/Homebrew/test/cmd/search_remote_tap_spec.rb3
-rw-r--r--Library/Homebrew/test/cmd/search_spec.rb14
4 files changed, 18 insertions, 7 deletions
diff --git a/Library/Homebrew/test/cmd/commands_spec.rb b/Library/Homebrew/test/cmd/commands_spec.rb
index cf6f56740..46ed3ddcf 100644
--- a/Library/Homebrew/test/cmd/commands_spec.rb
+++ b/Library/Homebrew/test/cmd/commands_spec.rb
@@ -68,7 +68,7 @@ describe Homebrew do
expect(cmds).to include("t1"), "Executable files should be included"
expect(cmds).to include("t2"), "Executable Ruby files should be included"
- expect(cmds).not_to include("t3"), "Executable files with a non Ruby extension shoudn't be included"
+ expect(cmds).not_to include("t3"), "Executable files with a non Ruby extension shouldn't be included"
expect(cmds).not_to include("t4"), "Non-executable files shouldn't be included"
end
end
diff --git a/Library/Homebrew/test/cmd/home_spec.rb b/Library/Homebrew/test/cmd/home_spec.rb
index 5a4070492..cf9453af2 100644
--- a/Library/Homebrew/test/cmd/home_spec.rb
+++ b/Library/Homebrew/test/cmd/home_spec.rb
@@ -7,10 +7,10 @@ describe "brew home", :integration_test do
end
it "opens the homepage for a given Formula" do
- setup_test_formula "testball"
+ setup_test_formula "testballhome"
- expect { brew "home", "testball", "HOMEBREW_BROWSER" => "echo" }
- .to output("#{Formula["testball"].homepage}\n").to_stdout
+ expect { brew "home", "testballhome", "HOMEBREW_BROWSER" => "echo" }
+ .to output("#{Formula["testballhome"].homepage}\n").to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
diff --git a/Library/Homebrew/test/cmd/search_remote_tap_spec.rb b/Library/Homebrew/test/cmd/search_remote_tap_spec.rb
index b0beb122c..eb256b924 100644
--- a/Library/Homebrew/test/cmd/search_remote_tap_spec.rb
+++ b/Library/Homebrew/test/cmd/search_remote_tap_spec.rb
@@ -2,6 +2,9 @@ require "cmd/search"
describe Homebrew do
specify "#search_taps" do
+ # Otherwise the tested method returns [], regardless of our stub
+ ENV.delete("HOMEBREW_NO_GITHUB_API")
+
json_response = {
"items" => [
{
diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb
index 06b7073d8..36ddde3e1 100644
--- a/Library/Homebrew/test/cmd/search_spec.rb
+++ b/Library/Homebrew/test/cmd/search_spec.rb
@@ -1,6 +1,7 @@
describe "brew search", :integration_test do
before(:each) do
setup_test_formula "testball"
+ setup_remote_tap "caskroom/cask"
end
it "lists all available Formulae when no argument is given" do
@@ -13,7 +14,7 @@ describe "brew search", :integration_test do
it "supports searching by name" do
expect { brew "search", "testball" }
.to output(/testball/).to_stdout
- .and not_to_output.to_stderr
+ .and output(/Searching/).to_stderr
.and be_a_success
end
@@ -24,6 +25,13 @@ describe "brew search", :integration_test do
.and be_a_success
end
+ it "falls back to a GitHub tap search when no formula is found", :needs_network do
+ expect { brew "search", "caskroom/cask/firefox" }
+ .to output(/firefox/).to_stdout
+ .and output(/Searching/).to_stderr
+ .and be_a_success
+ end
+
describe "--desc" do
let(:desc_cache) { HOMEBREW_CACHE/"desc_cache.json" }
@@ -44,8 +52,8 @@ describe "brew search", :integration_test do
"fink" => "http://pdb.finkproject.org/pdb/browse.php?summary=testball",
"debian" => "https://packages.debian.org/search?keywords=testball&searchon=names&suite=all&section=all",
"opensuse" => "https://software.opensuse.org/search?q=testball",
- "fedora" => "https://admin.fedoraproject.org/pkgdb/packages/%2Atestball%2A/",
- "ubuntu" => "http://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all&section=all",
+ "fedora" => "https://apps.fedoraproject.org/packages/s/testball",
+ "ubuntu" => "https://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all&section=all",
}.each do |flag, url|
specify "--#{flag}" do
expect { brew "search", "--#{flag}", "testball", "HOMEBREW_BROWSER" => "echo" }