test/search: Fix stubbing of GitHub::API.open_rest call

Test failure:

```
Failure/Error:
  expect(described_class.search_taps("some-formula"))
    .to match(formulae: ["homebrew/foo/some-formula"], casks: ["homebrew/bar/some-cask"])

  GitHub::API asked to yield |[{"items"=>[{"path"=>"Formula/some-formula.rb", "repository"=>{"full_name"=>"Homebrew/homebrew-foo"}}, {"path"=>"Casks/some-cask.rb", "repository"=>{"full_name"=>"Homebrew/homebrew-bar"}}]}]| but no block was passed
```
This commit is contained in:
Issy Long 2023-02-25 21:54:17 +00:00
parent 8c75eab88a
commit 1edb59e086
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -39,7 +39,7 @@ describe Homebrew::Search do
], ],
} }
allow(GitHub::API).to receive(:open_rest).and_yield(json_response) allow(GitHub::API).to receive(:open_rest).and_return(json_response)
expect(described_class.search_taps("some-formula")) expect(described_class.search_taps("some-formula"))
.to match(formulae: ["homebrew/foo/some-formula"], casks: ["homebrew/bar/some-cask"]) .to match(formulae: ["homebrew/foo/some-formula"], casks: ["homebrew/bar/some-cask"])