Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: link rendering and code highlights #219

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
[![License](https://img.shields.io/hexpm/l/exvcr.svg)](http://opensource.org/licenses/MIT)

Record and replay HTTP interactions library for Elixir. It's inspired by
Ruby's VCR (https://github.com/vcr/vcr), and trying to provide similar
[Ruby's VCR](https://github.com/vcr/vcr), and trying to provide similar
functionalities.

### Basics

The following HTTP libraries can be applied.

- <a href="https://github.com/cmullaparthi/ibrowse" target="_blank">ibrowse</a>-based libraries.
- <a href="https://github.com/myfreeweb/httpotion" target="_blank">HTTPotion</a>
- <a href="https://github.com/benoitc/hackney" target="_blank">hackney</a>-based libraries.
- <a href="https://github.com/edgurgel/httpoison" target="_blank">HTTPoison</a>
- [ibrowse](https://github.com/cmullaparthi/ibrowse){:target="_blank" rel="noopener"}-based libraries.
- [HTTPotion](https://github.com/myfreeweb/httpotion){:target="_blank" rel="noopener"}
- [hackney](https://github.com/benoitc/hackney){:target="_blank" rel="noopener"}-based libraries.
- [HTTPoison](https://github.com/edgurgel/httpoison){:target="_blank" rel="noopener"}
- support is very limited, and tested only with sync request of HTTPoison yet.
- <a href="http://erlang.org/doc/man/httpc.html" target="_blank">httpc</a>-based libraries.
- <a href="https://github.com/tim/erlang-oauth/" target="_blank">erlang-oauth</a>
- <a href="https://github.com/Zatvobor/tirexs" target="_blank">tirexs</a>
- [httpc](http://erlang.org/doc/man/httpc.html){:target="_blank" rel="noopener"}-based libraries.
- [erlang-oauth](https://github.com/tim/erlang-oauth/){:target="_blank" rel="noopener"}
- [tirexs](https://github.com/Zatvobor/tirexs){:target="_blank" rel="noopener"}
- support is very limited, and tested only with `:httpc.request/1` and `:httpc.request/4`.
- <a href="https://github.com/keathley/finch" target="_blank">Finch</a>
- [Finch](https://github.com/keathley/finch){:target="_blank" rel="noopener"}
- the deprecated `Finch.request/6` functions is not supported

HTTP interactions are recorded as JSON file. The JSON file can be recorded
Expand Down Expand Up @@ -64,7 +64,7 @@ using `hackney`, specify `adapter: ExVCR.Adapter.Hackney` options as follows.

##### Example with ibrowse

```Elixir
```elixir
defmodule ExVCR.Adapter.IBrowseTest do
use ExUnit.Case, async: true
use ExVCR.Mock
Expand Down Expand Up @@ -94,7 +94,7 @@ end

##### Example with hackney

```Elixir
```elixir
defmodule ExVCR.Adapter.HackneyTest do
use ExUnit.Case, async: true
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
Expand All @@ -114,7 +114,7 @@ end

##### Example with httpc

```Elixir
```elixir
defmodule ExVCR.Adapter.HttpcTest do
use ExUnit.Case, async: true
use ExVCR.Mock, adapter: ExVCR.Adapter.Httpc
Expand All @@ -136,7 +136,7 @@ end

##### Example with Finch

```Elixir
```elixir
defmodule ExVCR.Adapter.FinchTest do
use ExUnit.Case, async: true
use ExVCR.Mock, adapter: ExVCR.Adapter.Finch
Expand All @@ -161,13 +161,13 @@ end

Instead of single `use_cassette`, `start_cassette` and `stop_cassette` can serve as an alternative syntax.

```Elixir
```elixir
use_cassette("x") do
do_something
end
```

```Elixir
```elixir
start_cassette("x")
do_something
stop_cassette
Expand All @@ -187,7 +187,7 @@ control rather than just recoding the actual server response.
of requesting to server.


```Elixir
```elixir
defmodule ExVCR.MockTest do
use ExUnit.Case, async: true
import ExVCR.Mock
Expand Down Expand Up @@ -667,7 +667,7 @@ iex(2)> ExVCR.IEx.print(adapter: ExVCR.Adapter.Hackney) do
Specifying `:stub` as fixture name allows directly stubbing the response
header/body information based on parameter.

```Elixir
```elixir
test "stub request works for HTTPotion" do
use_cassette :stub, [url: "http://example.com", body: "Stub Response", status_code: 200] do
response = HTTPotion.get("http://example.com", [])
Expand Down Expand Up @@ -733,7 +733,7 @@ If the specified `:url` parameter doesn't match requests called inside the
The `:url` can be regular expression string. Please note that you should use
the `~r` sigil with `/` as delimiters.

```Elixir
```elixir
test "match URL with regular expression" do
use_cassette :stub, [url: "~r/(foo|bar)/", body: "Stub Response", status_code: 200] do
# ...
Expand Down
Loading