diff --git a/extensions/raxx_view/test/raxx/view/layout_test.exs b/extensions/raxx_view/test/raxx/view/layout_test.exs index 94ca2da..28b5d1b 100644 --- a/extensions/raxx_view/test/raxx/view/layout_test.exs +++ b/extensions/raxx_view/test/raxx/view/layout_test.exs @@ -25,13 +25,18 @@ defmodule Raxx.View.LayoutTest do end test "List of imports are available in template" do - assert ["foobar", "7", "layout_function", "helper_function"] = + assert ["foobar", "7", "layout_function", "helper_function" | _] = lines("#{DefaultLayoutExample.html(3, 4)}") end test "optional arguments can be overwritten in layout" do - assert ["bazbaz", "7", "layout_function", "helper_function"] = - lines("#{DefaultLayoutExample.html(3, 4, foo: "baz", bar: "baz")}") + assert ["bazbaz" | _] = lines("#{DefaultLayoutExample.html(3, 4, foo: "baz", bar: "baz")}") + end + + test "File and line information is correct" do + assert [_, _, _, _, view_file, layout_file] = lines("#{DefaultLayoutExample.html(3, 4)}") + assert Path.join(__DIR__, "/layout_test_example.html.eex") <> ":4" == view_file + assert Path.join(__DIR__, "/layout_test.html.eex") <> ":3" == layout_file end defp lines(text) do diff --git a/extensions/raxx_view/test/raxx/view/layout_test.html.eex b/extensions/raxx_view/test/raxx/view/layout_test.html.eex index 1446cc5..c5602e7 100644 --- a/extensions/raxx_view/test/raxx/view/layout_test.html.eex +++ b/extensions/raxx_view/test/raxx/view/layout_test.html.eex @@ -1,2 +1,3 @@ <%= foo %><%= bar %> <%= __content__ %> +<%= __ENV__.file %>:<%= __ENV__.line %> diff --git a/extensions/raxx_view/test/raxx/view/layout_test_example.html.eex b/extensions/raxx_view/test/raxx/view/layout_test_example.html.eex index cb6aab9..4e6047d 100644 --- a/extensions/raxx_view/test/raxx/view/layout_test_example.html.eex +++ b/extensions/raxx_view/test/raxx/view/layout_test_example.html.eex @@ -1,3 +1,4 @@ <%= x + y %> <%= layout_function() %> <%= helper_function() %> +<%= __ENV__.file %>:<%= __ENV__.line %>