Convert search_remote_tap test to spec.
This commit is contained in:
parent
bd0a1314c8
commit
423f22df00
19
Library/Homebrew/test/cmd/search_remote_tap_spec.rb
Normal file
19
Library/Homebrew/test/cmd/search_remote_tap_spec.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
require "cmd/search"
|
||||||
|
|
||||||
|
describe Homebrew do
|
||||||
|
specify "#search_tap" do
|
||||||
|
json_response = {
|
||||||
|
"tree" => [
|
||||||
|
{
|
||||||
|
"path" => "Formula/not-a-formula.rb",
|
||||||
|
"type" => "blob",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
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"])
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,19 +0,0 @@
|
|||||||
require "testing_env"
|
|
||||||
require "cmd/search"
|
|
||||||
|
|
||||||
class SearchRemoteTapTests < Homebrew::TestCase
|
|
||||||
def test_search_remote_tap
|
|
||||||
json_response = {
|
|
||||||
"tree" => [
|
|
||||||
{
|
|
||||||
"path" => "Formula/not-a-formula.rb",
|
|
||||||
"type" => "blob",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
GitHub.stubs(:open).yields(json_response)
|
|
||||||
|
|
||||||
assert_equal ["homebrew/not-a-tap/not-a-formula"], Homebrew.search_tap("homebrew", "not-a-tap", "not-a-formula")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Loading…
x
Reference in New Issue
Block a user