elixir-maru / maru

Elixir RESTful Framework
https://maru.readme.io
BSD 3-Clause "New" or "Revised" License
1.32k stars 84 forks source link

Can't get basic tests to work #33

Closed dblock closed 8 years ago

dblock commented 8 years ago

I am sure this is a problem between the computer and the chair since I am an Elixir noob, but I would appreciate some help.

https://github.com/dblock/aprb/tree/tests

A very simple endpoint:

defmodule Aprb.Api.Ping do
  use Maru.Router

  namespace :ping do
    desc "Ping which returns pong."
    get do
      json(conn, %{ ping: :pong })
    end
  end
end

A very simple test:

defmodule Aprb.ApiTest do
  use ExUnit.Case, async: true
  use Maru.Test, for: Aprb.Api.Ping

  test "/ping" do
    assert "pong" = get("/ping") |> text_response
  end
end

Running mix test

** (CompileError) test/api/ping_test.exs:6: undefined function get/1
    (stdlib) lists.erl:1338: :lists.foreach/2
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    (elixir) lib/code.ex:363: Code.require_file/2
    (elixir) lib/kernel/parallel_require.ex:56: anonymous fn/2 in Kernel.ParallelRequire.spawn_requires/5

Halp?

falood commented 8 years ago

I haven't release new version test future #26 . Could you please use master version of maru temporarily by modifying deps as [{:maru, github: "falood/maru"}] ? I'll release a new version today!

dblock commented 8 years ago

Yep, that works, my bad. Thanks! Maybe a note like Grape on the fact that the README describes an unreleased version could be helpful. I'll try to contribute.