diff options
| author | Mike McQuaid | 2017-04-24 14:11:04 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2017-04-24 14:11:04 +0100 |
| commit | b3c69aba87f21bb2a3b6a78de3328e22fe39e1c6 (patch) | |
| tree | 8e2e701e5b11f218c326c8f21d55711dda0e90bc /Library/Homebrew/test | |
| parent | 581e3b791e6ed6a492b1b6831c128e7c535e45ff (diff) | |
| download | brew-b3c69aba87f21bb2a3b6a78de3328e22fe39e1c6.tar.bz2 | |
search: use single HTTP call for tap searches.
Use GitHub's code search API to search using the filename based on the
search query. This means we only need a single HTTP call and no more
multithreading madness. This also means we're able to search everything
in the Homebrew and Caskroom organisation by default without having to
maintain a list of things to search (and not) in here.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/cmd/search_remote_tap_spec.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/test/cmd/search_remote_tap_spec.rb b/Library/Homebrew/test/cmd/search_remote_tap_spec.rb index 99c2cc20b..be7c20865 100644 --- a/Library/Homebrew/test/cmd/search_remote_tap_spec.rb +++ b/Library/Homebrew/test/cmd/search_remote_tap_spec.rb @@ -1,19 +1,24 @@ require "cmd/search" describe Homebrew do - specify "#search_tap" do + specify "#search_taps" do json_response = { - "tree" => [ + "items" => [ { - "path" => "Formula/not-a-formula.rb", - "type" => "blob", + "path" => "Formula/some-formula.rb", + "repository" => { + "name" => "homebrew-foo", + "owner" => { + "login" => "Homebrew", + }, + }, }, ], } allow(GitHub).to receive(:open).and_yield(json_response) - expect(described_class.search_tap("homebrew", "not-a-tap", "not-a-formula")) - .to eq(["homebrew/not-a-tap/not-a-formula"]) + expect(described_class.search_taps("some-formula")) + .to match(["homebrew/foo/some-formula"]) end end |
