{"id":20743181,"url":"https://github.com/httprb/http-rspec","last_synced_at":"2025-10-14T15:39:48.097Z","repository":{"id":185655288,"uuid":"673490642","full_name":"httprb/http-rspec","owner":"httprb","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-22T16:44:12.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-14T15:39:47.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/httprb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-01T18:41:07.000Z","updated_at":"2024-05-17T16:55:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a40509df-fd68-4104-a8c5-eadaf33ddcd9","html_url":"https://github.com/httprb/http-rspec","commit_stats":null,"previous_names":["httprb/http-rspec"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/httprb/http-rspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httprb%2Fhttp-rspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httprb%2Fhttp-rspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httprb%2Fhttp-rspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httprb%2Fhttp-rspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/httprb","download_url":"https://codeload.github.com/httprb/http-rspec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httprb%2Fhttp-rspec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019345,"owners_count":26086711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-17T07:09:31.314Z","updated_at":"2025-10-14T15:39:48.081Z","avatar_url":"https://github.com/httprb.png","language":"Ruby","readme":"# ![http.rb](logo.png)![RSpec](logo-rspec.png)\n\n[![Gem Version][gem-image]][gem-link]\n[![MIT licensed][license-image]][license-link]\n[![Build Status][build-image]][build-link]\n\n[Documentation]\n\n## About\n\nHTTP (The Gem! a.k.a. http.rb) is an easy-to-use client library for making requests\nfrom Ruby. RSpec is a Behaviour Driven Development spec libary for Ruby. Making TDD\nProductive and Fun.\n\nThis gem adds custom matchers to make it easier to check http requests.\n\n## Installation\n\nAdd the gem to your gemfile with bundler\n```bash\n$ bundle add http-rspec  --require\n```\nor manually\n```\ngem \"http-rspec\", require: false\n````\n\nInside of your spec helper (default spec_helper.rb):\n```ruby\nrequire \"http/rspec\"\n```\n\nNow you have to include the matchers you want for the blocks you want\n```ruby\n# in spec_helper.rb to include matchers everywhere\nRSpec.configure do |config|\n  config.include HTTP::Support::RspecMatchers\nend\n\n# in spec_helper.rb to include where the type is service\nRSpec.configure do |config|\n  config.include HTTP::Support::RspecMatchers, type: :service\nend\n\n# in the individual describe blocks\nRSpec.describe Service do\n  include HTTP::Support::RspecMatchers\n\n  it \"makes request\" do\n    expect(response).to be_an_http_gem_response.with(status: 200)\n  end\nend\n```\n\n## Documentation\n\nMost things are documented here in the readme\nThe following API documentation is also available:\n\n- [YARD API documentation](https://www.rubydoc.info/github/httprb/http-rspec)\n\n### Basic Usage\n\nHere's some simple examples to get you started:\n\n```ruby\n  it \"has successful response\" do\n    response = HTTP.get(\"www.nrk.no\")\n    expect(response).to be_an_http_gem_response.with(status: :success) # will match 2xx status code\n    expect(response).to be_an_http_gem_response.with(status: :redirect) # will match 3xx status code\n    expect(response).to be_an_http_gem_response.with(status: :error) # will match 3xx status code\n\n    expect(response).to be_an_http_gem_response.with(status: :ok) # require 200 status code\n    expect(response).to be_an_http_gem_response.with(status: 200) # require 200 status code\n    expect(response).to be_an_http_gem_response.with(status: :not_found) # require 404 status code\n    expect(response).to be_an_http_gem_response.with(status: 404) # require 404 status code\n\n    # you can access HTTP::Support::RspecMatchers::STATUS_CODE_TO_SYMBOL to see the full\n    # mapping between code and symbol\n  end\n```\n\n## Supported Ruby Versions\n\nThis library aims to support and is [tested against][build-link]\nthe following Ruby  versions:\n\n- Ruby 3.0\n- Ruby 3.1\n- Ruby 3.2\n\nIf something doesn't work on one of these versions, it's a bug.\n\nThis library may inadvertently work (or seem to work) on other Ruby versions,\nhowever support will only be provided for the versions listed above.\n\nIf you would like this library to support another Ruby version or\nimplementation, you may volunteer to be a maintainer. Being a maintainer\nentails making sure all tests run and pass on that implementation. When\nsomething breaks on your implementation, you will be responsible for providing\npatches in a timely fashion. If critical issues for a particular implementation\nexist at the time of a major release, support for that Ruby version may be\ndropped.\n\n\n## Contributing to http.rb rspec\n\n- Fork http.rb on GitHub\n- Make your changes\n- Ensure all tests pass (`bundle exec rake`)\n- Send a pull request\n- If we like them we'll merge them\n- If we've accepted a patch, feel free to ask for commit access!\n\n\n## Copyright\n\nCopyright © 2011-2023 Tony Arcieri, Alexey V. Zapparov, Erik Michaels-Ober, Zachary Anker, Simon Toivo Telhaug\nSee LICENSE.txt for further details.\n\n\n[//]: # (badges)\n\n[gem-image]: https://img.shields.io/gem/v/httprb_status?logo=ruby\n[gem-link]: https://rubygems.org/gems/http_rspec\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\n[license-link]: https://github.com/httprb/http-rspec/blob/main/LICENSE.txt\n[build-image]: https://github.com/httprb/http-rspec/workflows/CI/badge.svg\n[build-link]: https://github.com/httprb/http-rspec/actions/workflows/ci.yml\n\n[//]: # (links)\n\n[documentation]: https://github.com/httprb/http-rspec/wiki\n[requests]: https://docs.python-requests.org/en/latest/\n[llhttp]: https://llhttp.org/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttprb%2Fhttp-rspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttprb%2Fhttp-rspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttprb%2Fhttp-rspec/lists"}