Skip to content

Latest commit

 

History

History
86 lines (68 loc) · 2.17 KB

File metadata and controls

86 lines (68 loc) · 2.17 KB

Contributing

Key goals

  • 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

Inspirations

This project source code and coding style was inspired by the most awesome Ruby Gems:

Code quality expectations

  • 0 lint offense: rake lint
  • 100% tests passing: rake test
  • 100% code coverage: rake coverage (simple-cov)

Continuous integration

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 dependency

Check code quality using Lint.

$ rake lint

Run basic test

$ rake test

Run tests with code coverage

$ rake coverage

Review coverage report generated by rake coverage

# Current coverage: 98.68% (75 / 76 lines)
open coverage/index.html

Review documentation generated by rake doc

open doc/index.html

Run full regression test suite on the examples.

rake regression

Test the actuall packaged gem locally using the demo scripts.

$ rake oobt

Open ./Rakefile for more information.