http_sim - Easy HTTP Simulators
Simulate your external HTTP integrations.
Contributions and issues very welcome.
Usage
- Add
gem 'http_sim'to yourGemfile bundle installUse this code somewhere:
require 'http_sim' HttpSimulator.register_endpoint 'GET', '/hi', read_file('fixtures/some_page.html') HttpSimulator.register_endpoint 'POST', '/bye', read_file('fixtures/some_response.json') HttpSimulator.run!(port:6565)The endpoints
GET /hiandPOST /byeare now set up. Visithttp://localhost:6565/to see an index of running simulators and their helpers.
Contributing
- Fork it ( https://github.com/[my-github-username]/scaffold/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature')- Please add a test
- Run tests with
bundle install && rspec - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request