diff options
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/cask/cli/search_spec.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/test/cmd/search_remote_tap_spec.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/test/utils/github_spec.rb | 13 |
3 files changed, 17 insertions, 7 deletions
diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb index 9843a6de6..00fcf7382 100644 --- a/Library/Homebrew/test/cask/cli/search_spec.rb +++ b/Library/Homebrew/test/cask/cli/search_spec.rb @@ -3,7 +3,7 @@ describe Hbc::CLI::Search, :cask do expect { Hbc::CLI::Search.run("local") }.to output(<<-EOS.undent).to_stdout - ==> Partial matches + ==> Partial Matches local-caffeine local-transmission EOS @@ -42,13 +42,13 @@ describe Hbc::CLI::Search, :cask do it "accepts a regexp argument" do expect { Hbc::CLI::Search.run("/^local-c[a-z]ffeine$/") - }.to output("==> Regexp matches\nlocal-caffeine\n").to_stdout + }.to output("==> Regexp Matches\nlocal-caffeine\n").to_stdout end it "Returns both exact and partial matches" do expect { Hbc::CLI::Search.run("test-opera") - }.to output(/^==> Exact match\ntest-opera\n==> Partial matches\ntest-opera-mail/).to_stdout + }.to output(/^==> Exact Match\ntest-opera\n==> Partial Matches\ntest-opera-mail/).to_stdout end it "does not search the Tap name" do diff --git a/Library/Homebrew/test/cmd/search_remote_tap_spec.rb b/Library/Homebrew/test/cmd/search_remote_tap_spec.rb index be7c20865..b0beb122c 100644 --- a/Library/Homebrew/test/cmd/search_remote_tap_spec.rb +++ b/Library/Homebrew/test/cmd/search_remote_tap_spec.rb @@ -7,10 +7,7 @@ describe Homebrew do { "path" => "Formula/some-formula.rb", "repository" => { - "name" => "homebrew-foo", - "owner" => { - "login" => "Homebrew", - }, + "full_name" => "Homebrew/homebrew-foo", }, }, ], diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb new file mode 100644 index 000000000..9b539262f --- /dev/null +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -0,0 +1,13 @@ +require "utils/github" + +describe GitHub do + describe "::search_code", :needs_network do + it "searches code" do + results = subject.search_code("repo:Homebrew/brew", "path:/", "filename:readme", "language:markdown") + + expect(results.count).to eq(1) + expect(results.first["name"]).to eq("README.md") + expect(results.first["path"]).to eq("README.md") + end + end +end |
