aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/utils/github_spec.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-24 19:31:54 +0200
committerMarkus Reiter2017-04-25 12:29:01 +0200
commit4b804389e120d7172d0af541971e4e33f3447fc2 (patch)
tree62f35f8d43539f9f7c3686c71f96fb6f574e4cdc /Library/Homebrew/test/utils/github_spec.rb
parent238cd5430f47895ef930756f2c3fb8b770a89f46 (diff)
downloadbrew-4b804389e120d7172d0af541971e4e33f3447fc2.tar.bz2
Add test for `GitHub::search_code`.
Diffstat (limited to 'Library/Homebrew/test/utils/github_spec.rb')
-rw-r--r--Library/Homebrew/test/utils/github_spec.rb13
1 files changed, 13 insertions, 0 deletions
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