- Brand centric instead of search engine based
- No hard-coded logic per search engine
- Simple HTTP client (lightweight, reduced dependency)
- No magic default values
- Thread safe
- Easy extension
- Defensive code style (raise a custom exception)
- TDD - Test driven development
- Best API coding practice per platform
- KiSS principles
This project source code and coding style was inspired by the most awesome Ruby Gems:
- 0 lint offense:
rake lint - 100% tests passing:
rake test - 100% code coverage:
rake coverage(simple-cov)
We love continuous integration (CI) and Test-Driven Development (TDD) at SerpApi. We use RSpec and Github Actions to test our infrastructure around the clock, and that includes all changes to our clients.
The directory spec/ includes specification which serves the dual purposes of examples and functional tests.
Set your secret API key in your shell before running a test. The SerpApi key can be obtained from serpapi.com/signup.
export SERPAPI_KEY="your_secret_key"Install testing dependency
$ bundle install
# or
$ rake dependencyCheck code quality using Lint.
$ rake lintRun basic test
$ rake testRun tests with code coverage
$ rake coverageReview coverage report generated by rake coverage
# Current coverage: 98.68% (75 / 76 lines)
open coverage/index.htmlReview documentation generated by rake doc
open doc/index.htmlRun full regression test suite on the examples.
rake regressionTest the actuall packaged gem locally using the demo scripts.
$ rake oobtOpen ./Rakefile for more information.