Skip to content

Commit

Permalink
Update readme and example
Browse files Browse the repository at this point in the history
  • Loading branch information
parroty committed Mar 17, 2014
1 parent 6a226f5 commit 9b79a59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -84,8 +84,9 @@ defmodule ExVCR.Adapter.HttpcTest do

test "get request" do
use_cassette "example_httpc_request" do
{:ok, {{_http_version, status_code = 200, _reason_phrase}, headers, body}} = :httpc.request('http://example.com')
assert to_string(body) =~ %r/Example Domain/
{:ok, result} = :httpc.request('http://example.com')
{{_http_version, _status_code = 200, _reason_phrase}, _headers, body} = result
assert to_string(body) =~ ~r/Example Domain/
end
end
```
Expand Down Expand Up @@ -156,7 +157,8 @@ If `ExVCR.Config.filter_url_params(true)` is specified, query params in url will
test "filter url param flag removes url params when recording cassettes" do
ExVCR.Config.filter_url_params(true)
use_cassette "example_ignore_url_params" do
assert HTTPotion.get("http://localhost:34000/server?should_not_be_contained", []).body =~ %r/test_response/
assert HTTPotion.get(
"http://localhost:34000/server?should_not_be_contained", []).body =~ %r/test_response/
end
json = File.read!("#{__DIR__}/../#{@dummy_cassette_dir}/example_ignore_url_params.json")
refute String.contains?(json, "should_not_be_contained")
Expand Down
3 changes: 2 additions & 1 deletion test/adapter_httpc_test.exs
Expand Up @@ -9,7 +9,8 @@ defmodule ExVCR.Adapter.HttpcTest do

test "example httpc request/1" do
use_cassette "example_httpc_request_1" do
{:ok, {{_http_version, _status_code = 200, _reason_phrase}, _headers, body}} = :httpc.request('http://example.com')
{:ok, result} = :httpc.request('http://example.com')
{{_http_version, _status_code = 200, _reason_phrase}, _headers, body} = result
assert to_string(body) =~ ~r/Example Domain/
end
end
Expand Down

0 comments on commit 9b79a59

Please sign in to comment.