Skip to content

Instantly share code, notes, and snippets.

@stevedomin
Created June 20, 2014 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevedomin/b1406488e8f719412baa to your computer and use it in GitHub Desktop.
Save stevedomin/b1406488e8f719412baa to your computer and use it in GitHub Desktop.
Dynamo - Elixir 0.14.1 - Failing specs
..............................................................................................
1) test forwarding on root with dynamic path and params (Dynamo.Router.BaseTest)
test/dynamo/router/base_test.exs:167
** (ArgumentError) argument error
stacktrace:
(stdlib) :maps.merge(%{}, [glob: ["12", "hello"]])
(dynamo) lib/dynamo/connection/behaviour.ex:133: Dynamo.Connection.Test.route_params/2
test/dynamo/router/base_test.exs:69: Dynamo.Router.BaseTest.RootSample.dispatch/3
(dynamo) lib/dynamo/http/case.ex:250: Dynamo.HTTP.Case.do_process/2
test/dynamo/router/base_test.exs:168
..........
2) test forwarding on root (Dynamo.Router.BaseTest)
test/dynamo/router/base_test.exs:163
** (ArgumentError) argument error
stacktrace:
(stdlib) :maps.merge(%{}, [glob: ["1", "bar"]])
(dynamo) lib/dynamo/connection/behaviour.ex:133: Dynamo.Connection.Test.route_params/2
test/dynamo/router/base_test.exs:69: Dynamo.Router.BaseTest.RootSample.dispatch/3
(dynamo) lib/dynamo/http/case.ex:250: Dynamo.HTTP.Case.do_process/2
test/dynamo/router/base_test.exs:164
............
3) test dispatch root (Dynamo.Router.BaseTest)
test/dynamo/router/base_test.exs:75
** (ArgumentError) argument error
stacktrace:
(stdlib) :maps.merge(%{}, [glob: []])
(dynamo) lib/dynamo/connection/behaviour.ex:133: Dynamo.Connection.Test.route_params/2
test/dynamo/router/base_test.exs:69: Dynamo.Router.BaseTest.RootSample.dispatch/3
(dynamo) lib/dynamo/http/case.ex:250: Dynamo.HTTP.Case.do_process/2
test/dynamo/router/base_test.exs:77
..........................................
4) test req_resp_cookies (Dynamo.Cowboy.ConnectionTest)
test/dynamo/cowboy/connection_test.exs:227
Expected successful response, got status 500 with body "Assertion with == failed\n (dynamo) lib/dynamo/cowboy/handler.ex:15: Dynamo.Cowboy.Handler.init/3\n (cowboy) src/cowboy_handler.erl:66: :cowboy_handler.handler_init/4\n (cowboy) src/cowboy_protocol.erl:435: :cowboy_protocol.execute/4\n"
stacktrace:
test/dynamo/cowboy/connection_test.exs:229
........
5) test inspect (Dynamo.Cowboy.ConnectionTest)
test/dynamo/cowboy/connection_test.exs:431
match (=) failed
code: {200, _, "#Dynamo.Connection<GET /conn_inspect (cowboy)>"} = request(:get, "/conn_inspect")
rhs: {200, [{"connection", "keep-alive"}, {"server", "Cowboy"}, {"date", "Fri, 20 Jun 2014 22:18:38 GMT"}, {"content-length", "638"}, {"cache-control", "max-age=0, private, must-revalidate"}],
"{Dynamo.Cowboy.Connection, [], [#Function<0.447956/1 in Dynamo.Connection.default_before_send/0>], [], Dynamo.Cowboy.ConnectionTest, \"GET\", nil, nil, [\"conn_inspect\"], [], nil, nil, nil, \"\", \"utf-8\", [], nil, %{\"cache-control\" => \"max-age=0, private, must-revalidate\"}, [], :unset, nil, [], {:http_req, #Port<0.12612>, :ranch_tcp, :keepalive, #PID<0.1081.0>, \"GET\", :\"HTTP/1.1\", {{127, 0, 0, 1}, 57477}, \"127.0.0.1\", :undefined, 8011, \"/conn_inspect\", :undefined, \"\", :undefined, [], [{\"user-agent\", \"hackney/0.12.1\"}, {\"host\", \"127.0.0.1:8011\"}], [], :undefined, [], :waiting, \"\", :undefined, false, :waiting, [], \"\", :undefined}, :http}"}
stacktrace:
test/dynamo/cowboy/connection_test.exs:432
.......
6) test req_cookies (Dynamo.Cowboy.ConnectionTest)
test/dynamo/cowboy/connection_test.exs:210
Expected successful response, got status 500 with body "Assertion with == failed\n (dynamo) lib/dynamo/cowboy/handler.ex:15: Dynamo.Cowboy.Handler.init/3\n (cowboy) src/cowboy_handler.erl:66: :cowboy_handler.handler_init/4\n (cowboy) src/cowboy_protocol.erl:435: :cowboy_protocol.execute/4\n"
stacktrace:
test/dynamo/cowboy/connection_test.exs:212
...
7) test params (Dynamo.Cowboy.ConnectionTest)
test/dynamo/cowboy/connection_test.exs:140
Expected successful response, got status 500 with body "Assertion with == failed\n (dynamo) lib/dynamo/cowboy/handler.ex:15: Dynamo.Cowboy.Handler.init/3\n (cowboy) src/cowboy_handler.erl:66: :cowboy_handler.handler_init/4\n (cowboy) src/cowboy_protocol.erl:435: :cowboy_protocol.execute/4\n"
stacktrace:
test/dynamo/cowboy/connection_test.exs:141
...................................
8) test compiles an application (Mix.TasksTest)
test/mix/tasks_test.exs:5
Assertion with =~ failed
code: output =~ sigil_r(<<"Compiled web/routers/application_router.ex">>, [])
lhs: "Compiled lib/my_app.ex\nCompiled lib/my_app/dynamo.ex\n** (UndefinedFunctionError) undefined function: Mix.Utils.read_manifest/1\n (mix) Mix.Utils.read_manifest(\"/Users/steve/code/elixir/dynamo/tmp/my_compiled_app/_build/prod/lib/my_compiled_app/ebin/.compile.dynamo\")\n (dynamo) lib/mix/tasks/compile.dynamo.ex:81: Mix.Tasks.Compile.Dynamo.do_compile/3\n (elixir) lib/enum.ex:1252: Enum.\"-reduce/3-lists^foldl/2-0-\"/3\n (mix) lib/mix/tasks/compile.ex:63: anonymous fn/2 in Mix.Tasks.Compile.run/1\n (elixir) lib/enum.ex:967: Enum.\"-map/2-lc$^0/1-0-\"/2\n (elixir) lib/enum.ex:967: Enum.\"-map/2-lc$^0/1-0-\"/2\n (mix) lib/mix/tasks/compile.ex:62: Mix.Tasks.Compile.run/1\n (mix) lib/mix/cli.ex:66: Mix.CLI.run_task/2\n\n"
rhs: ~r/Compiled web\/routers\/application_router.ex/
stacktrace:
test/mix/tasks_test.exs:10: anonymous fn/0 in Mix.TasksTest.test compiles an application/1
(elixir) lib/file.ex:1162: File.cd!/2
test/mix/tasks_test.exs:6
................
9) test serves the file with a urlencoded filename (Dynamo.Filters.StaticTest)
test/dynamo/filters/static_test.exs:42
Assertion with == failed
code: conn.status() == 200
lhs: 404
rhs: 200
stacktrace:
test/dynamo/filters/static_test.exs:44
.
Finished in 7.0 seconds (2.0s on load, 5.0s on tests)
237 tests, 9 failures
Randomized with seed 574153
@nhu313
Copy link

nhu313 commented Jun 21, 2014

I'm still new to github so I'm not sure how to fix your changes directly. But failure #9 is an easy fix. The file name is incorrect, that's why it's returning a 404. In static_test.exs, on line 43, replace it with this line:

conn = get("/public/fixtures/static/file%20with%20spaces.txt")

I'll see if I can work through the other one over the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment