Convert search_remote_tap test to spec.

This commit is contained in:
Markus Reiter 2017-02-21 05:13:05 +01:00
parent bd0a1314c8
commit 423f22df00
2 changed files with 19 additions and 19 deletions

View 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

View File

@ -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