{"id":17681779,"url":"https://github.com/jgaskins/hot_topic","last_synced_at":"2025-05-12T22:03:29.763Z","repository":{"id":39672729,"uuid":"427798169","full_name":"jgaskins/hot_topic","owner":"jgaskins","description":"A fake HTTP client for making requests to your HTTP::Handler classes","archived":false,"fork":false,"pushed_at":"2023-06-07T04:38:33.000Z","size":5,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-12T22:03:11.996Z","etag":null,"topics":["http","stubbing","testing"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/jgaskins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-11-13T23:54:19.000Z","updated_at":"2024-07-16T11:22:58.000Z","dependencies_parsed_at":"2024-10-24T10:56:58.582Z","dependency_job_id":"e427c784-5cb1-4f27-a94f-5763204f62ed","html_url":"https://github.com/jgaskins/hot_topic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Fhot_topic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Fhot_topic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Fhot_topic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Fhot_topic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgaskins","download_url":"https://codeload.github.com/jgaskins/hot_topic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253830956,"owners_count":21971004,"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","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":["http","stubbing","testing"],"created_at":"2024-10-24T09:12:09.735Z","updated_at":"2025-05-12T22:03:29.696Z","avatar_url":"https://github.com/jgaskins.png","language":"Crystal","readme":"# HotTopic\n\nStubbing HTTP operations\n\n## Srsly why did you name it this?\n\nHotmail is HTML with extra letters, and HotTopic is HTTP with extra letters. Also, it makes me laugh.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     hot_topic:\n       github: jgaskins/hot_topic\n   ```\n\n2. Run `shards install`\n\n## Usage\n\nIn your test, instantiate a `HotTopic` client with an `HTTP::Handler` entrypoint (could be middleware or the specific route handler), call [any `HTTP::Client` method](https://crystal-lang.org/api/1.2.2/HTTP/Client.html) on it to get a response back as if you had made the request over HTTP.\n\nLet's say you have an `HTTP::Handler` called `MyApp`:\n\n```crystal\nrequire \"http\"\n\nclass MyApp\n  include HTTP::Handler\n\n  def call(context)\n    # ...\n  end\nend\n```\n\nIn your test, you can instantiate `HotTopic` with an instance of `MyApp`:\n\n```crystal\nrequire \"hot_topic\"\nclient = HotTopic.new(MyApp.new)\n```\n\nThen you can operate on `client` as if it were a real HTTP client as if it were an `HTTP::Client` request to a remote server. It even returns an actual [`HTTP::Client::Response`](https://crystal-lang.org/api/1.2.2/HTTP/Client/Response.html):\n\n```crystal\nresponse = client.get(\"/\")\n\n# do things with the response\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/jgaskins/hot_topic/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Jamie Gaskins](https://github.com/jgaskins) - creator and maintainer\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgaskins%2Fhot_topic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgaskins%2Fhot_topic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgaskins%2Fhot_topic/lists"}