{"id":15101708,"url":"https://github.com/pfac/webtrap","last_synced_at":"2026-01-18T19:01:39.115Z","repository":{"id":56898021,"uuid":"79965353","full_name":"pfac/webtrap","owner":"pfac","description":"Trap for catching outgoing HTTP requests.","archived":false,"fork":false,"pushed_at":"2017-12-21T11:22:55.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-06T13:17:30.710Z","etag":null,"topics":["rspec","ruby","testing"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-24T23:35:25.000Z","updated_at":"2017-02-10T09:08:05.000Z","dependencies_parsed_at":"2022-08-21T02:20:32.968Z","dependency_job_id":null,"html_url":"https://github.com/pfac/webtrap","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pfac/webtrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfac%2Fwebtrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfac%2Fwebtrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfac%2Fwebtrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfac%2Fwebtrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfac","download_url":"https://codeload.github.com/pfac/webtrap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfac%2Fwebtrap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28548944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rspec","ruby","testing"],"created_at":"2024-09-25T18:28:47.274Z","updated_at":"2026-01-18T19:01:39.094Z","avatar_url":"https://github.com/pfac.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"WebTrap\n=======\n\n[![Gem Version](https://badge.fury.io/rb/webtrap.svg)](https://badge.fury.io/rb/webtrap)\n[![Build Status](https://travis-ci.org/pfac/webtrap.svg?branch=master)](https://travis-ci.org/pfac/webtrap)\n[![Dependency Status](https://gemnasium.com/badges/github.com/pfac/webtrap.svg)](https://gemnasium.com/github.com/pfac/webtrap)\n[![Code Climate](https://codeclimate.com/github/pfac/webtrap/badges/gpa.svg)](https://codeclimate.com/github/pfac/webtrap)\n\nDocumentation:\n[![Usage Documentation](https://img.shields.io/badge/usage-0.1.1-brightgreen.svg?style=flat)](http://www.relishapp.com/pfac/webtrap/docs)\n[![API Documentation](https://img.shields.io/badge/api-0.1.1-brightgreen.svg?style=flat)](http://www.rubydoc.info/gems/webtrap)\n[![Documentation Coverage](https://inch-ci.org/github/pfac/webtrap.svg?branch=master)](https://inch-ci.org/github/pfac/webtrap)\n\nWebTrap allows you to write tests that assert on outgoing requests. This allows\nyou to verify that such requests match the documentation of external services\nwithout actually having to hit them.\n\n## Install\n\nTo install this library, just run the following command on your shell:\n\n```sh\n#!/bin/sh\ngem install webtrap\n```\n\nOr, if you're using [Bundler][bundler], add the following to your project's\n`Gemfile`:\n\n```ruby\n# Gemfile\ngem \"webtrap\", group: :test\n```\n\n\n## Usage\n\nWebTrap consists on a set of matchers that given a block where an HTTP request\nis sent provide the ability to assert over on the outgoing request.\n\n\n### Configuration\n\nIn order to use WebTrap matchers, make sure you require the correct file into\nyour configuration:\n\n\n#### RSpec\n\n```ruby\nrequire \"webtrap/rspec\"\n```\n\nInclude this line in the specs where you wish to use these matchers. If you\nprefer to make WebTrap matchers available to all specs add this line to\n`specs/spec_helper.rb`, or, if you are using `rspec-rails`, add it to\n`specs/support/webtrap.rb`.\n\n\n### Examples\n\n* Verify that a request is sent anywhere:\n  ```ruby\n  expect do\n    # ...\n  end.to send_request\n  ```\n\n* Verify that a request is send with a specific XML body (or [equivalent][equivalent-xml]):\n  ```ruby\n  expect do\n    # ...\n  end.to send_request.with_xml(xml)\n  ```\n\n\n## Contributing\n\nIf you find a problem, have an idea or a suggestion, but don't know how to\nimplement it, or if you simply have a question regarding this project,\n[please create an issue on GitHub][github-issue]. Your issue will be reviewed by\none of the main contributors and taken into consideration in the development of\nthe project.\n\nOn the other hand, if you are able to take action on the issue\n[please submit a pull request][github-pull-request] instead. Development will go\na lot faster with contributions from the community, be it in code, documentation\nor any other form.\n\nAny contribution is more than welcome.\n\n### Setup\n\nStart by cloning the project into your system and running the bootstrapping\nscript included to set up your development environment:\n\n```sh\n#!/bin/sh\ngit clone https://github.com/pfac/webtrap.git\ncd webtrap\n./bin/setup\n```\n\nHere's what the script does:\n\n1. Checks the existence of a compatible Ruby environment (MRI 2.0+);\n2. Checks the presence of [Bundler][bundler], and installs it if missing;\n3. Installs all dependencies.\n\nFeel free to check the script before running it. To check if everything is\ncorrectly set up run:\n\n```sh\n#!/bin/sh\nbundle exec rake\n```\n\nThat will run the linters and acceptance tests. If the tests fail please check\nthe [build status][travis-ci] for the branch you checked out. Unless the build\nstatus is already failing, please investigate the issue on your environment. If\nyou found a defect in the bootstraping script, please file an issue to let us\nknow (be as detailed as possible).\n\n\n### Development\n\nIn this project we use BDD with Cucumber. Ideally you should start with a\nsuccessful build, which you can check by running:\n\n```sh\n#!/bin/sh\nbundle exec rake\n```\n\nIt may happen that the branch where you started (usually `master`) is already\nbroken on [the CI][travis-ci]. If that is the case try to focus only on the scenarios you\nare working on, by running instead:\n\n```sh\n#!/bin/sh\ncucumber features/\u003cpath-to-file\u003e\n```\n\nStart by describing your idea in either a new scenario or a whole new feature\nfile. If you are not sure which one to go for, create a new feature file and\nsomeone will point you in the right direction during code revision. Make sure\nyour scenario fails before proceeding.\n\nAfter that, implement the necessary code required to make your scenario pass. If\nyou find yourself in trouble feel free to [create an issue][github-issue]\npointing to your changes and someone will try to help you.\n\nOnce your scenario passes, refactor as required. Make sure your code gets\nproperly checked by the linters. When you feel your changes are ready,\n[submit a pull request][github-pull-request]. We'll review it in the nicest way\npossible. :smile:\n\nFor a short-list to follow before submitting your pull request, see\n[CONTRIBUTING](./CONTRIBUTING.md).\n\n\n### Deployment\n\nAny main contributor can deploy a new version. To do so, update the version\nnumber as appropriate according to [Semantic Versioning][semver] and run the\ndeployment script:\n\n```sh\n#!/bin/sh\n./bin/deploy\n```\n\nOn the other hand, if you are not a main contributor with deployment\npermissions your idea will have to wait for a new version release to become\navailable in [RubyGems][rubygems] once it gets accepted.\n\nAt the moment there is no need for a release schedule, so new versions will be\nreleased at the discretion of the main contributors team. Should you require\na pending feature to be released, feel free to mention it in your pull request\nonce it gets merged, or to open a new issue. We'll try to honor such requests\nas much as possible when reasonable.\n\n\n## About\n\nWebTrap was originally designed by and is currently maintained by\n[Pedro Costa][pfac]. All artifacts in this project are released under the\n[MIT license](./LICENSE.txt).\n\n\n[bundler]: http://bundler.io/\n[equivalent-xml]: https://github.com/mbklein/equivalent-xml\n[github-issue]: https://github.com/pfac/webtrap/issues/new\n[github-pull-request]: https://github.com/pfac/webtrap/pull/new\n[pfac]: https://github.com/pfac\n[rubygems]: https://rubygems.org/gems/webtrap\n[semver]: http://semver.org/\n[travis-ci]: https://travis-ci.org/pfac/webtrap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfac%2Fwebtrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfac%2Fwebtrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfac%2Fwebtrap/lists"}