File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -58,3 +58,13 @@ brews:
5858 bin.install "serpapi"
5959 test : |
6060 assert_match version.to_s, shell_output("#{bin}/serpapi --version")
61+ assert_match "search", shell_output("#{bin}/serpapi --help")
62+ assert_match "organic_results", shell_output("#{bin}/serpapi search q=coffee")
63+ assert_match "google", shell_output("#{bin}/serpapi search q=coffee --jq .search_parameters.engine")
64+ assert_match "canonical_name", shell_output("#{bin}/serpapi locations q=Austin")
65+ assert_match "Invalid API key", shell_output("#{bin}/serpapi --api-key invalid search q=coffee 2>&1", 1)
66+ assert_match "Invalid API key", shell_output("#{bin}/serpapi --api-key invalid account 2>&1", 1)
67+ assert_match "No API key", shell_output("#{bin}/serpapi account 2>&1", 2)
68+ assert_match "No API key", shell_output("#{bin}/serpapi archive abc123 2>&1", 2)
69+ assert_match "Invalid archive ID", shell_output("#{bin}/serpapi --api-key x archive ../bad 2>&1", 2)
70+ assert_match "api_error", shell_output("#{bin}/serpapi --api-key invalid archive abc123 2>&1", 1)
You can’t perform that action at this time.
0 commit comments