mirror of
https://github.com/edgurgel/httparrot
synced 2025-04-06 00:32:34 -04:00
Update Elixir 0.14.1
This commit is contained in:
parent
be5058525c
commit
296e58a3b5
23 changed files with 45 additions and 102 deletions
|
@ -7,7 +7,7 @@ otp_release:
|
||||||
install: mix deps.get
|
install: mix deps.get
|
||||||
before_install:
|
before_install:
|
||||||
- mkdir -p vendor/elixir
|
- mkdir -p vendor/elixir
|
||||||
- wget -q https://github.com/elixir-lang/elixir/releases/download/v0.14.0/Precompiled.zip && unzip -qq Precompiled.zip -d vendor/elixir
|
- wget -q https://github.com/elixir-lang/elixir/releases/download/v0.14.1/Precompiled.zip && unzip -qq Precompiled.zip -d vendor/elixir
|
||||||
- export PATH="$PATH:$PWD/vendor/elixir/bin"
|
- export PATH="$PATH:$PWD/vendor/elixir/bin"
|
||||||
- export MIX_ENV=test
|
- export MIX_ENV=test
|
||||||
- mix local.hex --force
|
- mix local.hex --force
|
||||||
|
|
2
mix.exs
2
mix.exs
|
@ -5,7 +5,7 @@ defmodule Httparrot.Mixfile do
|
||||||
[ app: :httparrot,
|
[ app: :httparrot,
|
||||||
version: "0.2.1",
|
version: "0.2.1",
|
||||||
name: "HTTParrot",
|
name: "HTTParrot",
|
||||||
elixir: "~> 0.14.0",
|
elixir: "~> 0.14.1",
|
||||||
deps: deps ]
|
deps: deps ]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.Base64HandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "halts with error" do
|
test "halts with error" do
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.BasicAuthHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "is_authorized returns true if user and passwd match" do
|
test "is_authorized returns true if user and passwd match" do
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.CacheHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new HTTParrot.GeneralRequestInfo
|
new HTTParrot.GeneralRequestInfo
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload HTTParrot.GeneralRequestInfo
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns prettified json with query values, headers, url and origin" do
|
test "returns prettified json with query values, headers, url and origin" do
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.CookiesHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns a JSON with all the cookies o/" do
|
test "returns a JSON with all the cookies o/" do
|
||||||
|
|
|
@ -7,12 +7,8 @@ defmodule HTTParrot.DelayedHandlerTest do
|
||||||
new HTTParrot.GeneralRequestInfo
|
new HTTParrot.GeneralRequestInfo
|
||||||
new JSEX
|
new JSEX
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload HTTParrot.GeneralRequestInfo
|
|
||||||
unload JSEX
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "malformed_request returns false if it's not an integer" do
|
test "malformed_request returns false if it's not an integer" do
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.DeleteCookiesHandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "delete cookies and redirect to /cookies " do
|
test "delete cookies and redirect to /cookies " do
|
||||||
|
|
|
@ -7,12 +7,8 @@ defmodule HTTParrot.DeleteHandlerTest do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new HTTParrot.GeneralRequestInfo
|
new HTTParrot.GeneralRequestInfo
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload HTTParrot.GeneralRequestInfo
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns prettified json with query values, headers, url and origin" do
|
test "returns prettified json with query values, headers, url and origin" do
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.GeneralRequestInfoTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
doctest HTTParrot.GeneralRequestInfo
|
doctest HTTParrot.GeneralRequestInfo
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.GetHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new HTTParrot.GeneralRequestInfo
|
new HTTParrot.GeneralRequestInfo
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload HTTParrot.GeneralRequestInfo
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns prettified json with query values, headers, url and origin" do
|
test "returns prettified json with query values, headers, url and origin" do
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.HeadersHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns prettified json with headers list" do
|
test "returns prettified json with headers list" do
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.HiddenBasicAuthHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "resource_exists returns true if user and passwd match" do
|
test "resource_exists returns true if user and passwd match" do
|
||||||
|
|
|
@ -5,11 +5,10 @@ defmodule HTTParrotTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
|
||||||
|
|
||||||
test "'prettify_json' prettifies body response if it's a JSON" do
|
test "'prettify_json' prettifies body response if it's a JSON" do
|
||||||
expect(:cowboy_req, :reply, [{[:status, [{"content-length", '14'}], "{\n \"a\": \"b\"\n}", :req1], {:ok, :req2}}])
|
expect(:cowboy_req, :reply, [{[:status, [{"content-length", '14'}], "{\n \"a\": \"b\"\n}", :req1], {:ok, :req2}}])
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.IPHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns prettified json with origin" do
|
test "returns prettified json with origin" do
|
||||||
|
|
|
@ -7,12 +7,8 @@ defmodule HTTParrot.PHandlerTest do
|
||||||
new HTTParrot.GeneralRequestInfo
|
new HTTParrot.GeneralRequestInfo
|
||||||
new JSEX
|
new JSEX
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload HTTParrot.GeneralRequestInfo
|
|
||||||
unload JSEX
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Enum.each [{"/post", "POST"},
|
Enum.each [{"/post", "POST"},
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.RedirectHandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "malformed_request returns false if it's not an integer" do
|
test "malformed_request returns false if it's not an integer" do
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.RedirectToHandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "malformed_request returns true if no 'url' is defined" do
|
test "malformed_request returns true if no 'url' is defined" do
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.RelativeRedirectHandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "malformed_request returns false if it's not an integer" do
|
test "malformed_request returns false if it's not an integer" do
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.SetCookiesHandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "malformed_request returns false if /name/value is sent" do
|
test "malformed_request returns false if /name/value is sent" do
|
||||||
|
|
|
@ -5,10 +5,8 @@ defmodule HTTParrot.StatusCodeHandlerTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "reply with 'code' as status code" do
|
test "reply with 'code' as status code" do
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
defmodule HTTParrot.StreamHandlerTest do
|
defmodule HTTParrot.StreamHandlerTest do
|
||||||
use ExUnit.Case
|
use ExUnit.Case, async: false
|
||||||
import :meck
|
import :meck
|
||||||
import HTTParrot.StreamHandler
|
import HTTParrot.StreamHandler
|
||||||
|
|
||||||
|
@ -7,12 +7,8 @@ defmodule HTTParrot.StreamHandlerTest do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new HTTParrot.GeneralRequestInfo
|
new HTTParrot.GeneralRequestInfo
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload HTTParrot.GeneralRequestInfo
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "malformed_request returns false if it's not an integer" do
|
test "malformed_request returns false if it's not an integer" do
|
||||||
|
|
|
@ -6,11 +6,8 @@ defmodule HTTParrot.UserAgentHandlerTest do
|
||||||
setup do
|
setup do
|
||||||
new :cowboy_req
|
new :cowboy_req
|
||||||
new JSEX
|
new JSEX
|
||||||
end
|
on_exit fn -> unload end
|
||||||
|
:ok
|
||||||
teardown do
|
|
||||||
unload :cowboy_req
|
|
||||||
unload JSEX
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "returns prettified json with user agent" do
|
test "returns prettified json with user agent" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue