From 71600aae64025fbd5ff38c197f09d9ae8fcc1133 Mon Sep 17 00:00:00 2001 From: Geoff Lane Date: Wed, 24 Jun 2020 09:59:45 -0400 Subject: [PATCH 1/2] Update deps and fix tests for latest AST --- mix.exs | 2 +- mix.lock | 25 +++++------ test/scrivener/html_test.exs | 82 ++++++++++++++++++------------------ 3 files changed, 55 insertions(+), 54 deletions(-) diff --git a/mix.exs b/mix.exs index 4646472..9147dee 100644 --- a/mix.exs +++ b/mix.exs @@ -49,7 +49,7 @@ defmodule ScrivenerHtml.Mixfile do [ {:scrivener, "~> 1.2 or ~> 2.0"}, {:phoenix_html, "~> 2.2"}, - {:phoenix, "~> 1.0 and < 1.5.0", optional: true}, + {:phoenix, "~> 1.4", optional: true}, {:plug, "~> 1.1"}, {:ex_doc, "~> 0.19", only: :dev}, {:earmark, "~> 1.1", only: :dev} diff --git a/mix.lock b/mix.lock index 60a41fe..ceb9378 100644 --- a/mix.lock +++ b/mix.lock @@ -1,20 +1,21 @@ %{ "decimal": {:hex, :decimal, "1.1.2", "79a769d4657b2d537b51ef3c02d29ab7141d2b486b516c109642d453ee08e00c", [:mix], []}, - "earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"}, + "earmark": {:hex, :earmark, "1.4.5", "62ffd3bd7722fb7a7b1ecd2419ea0b458c356e7168c1f5d65caf09b4fbdd13c8", [:mix], [], "hexpm", "b7d0e6263d83dc27141a523467799a685965bf8b13b6743413f19a7079843f4f"}, "ecto": {:hex, :ecto, "1.1.8", "0f0348e678fa5a450c266d69816808f97fbd82ade32cf88d4b09bbe8f8c27545", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, optional: false]}, {:mariaex, "~> 0.5.0 or ~> 0.6.0", [hex: :mariaex, optional: true]}, {:poison, "~> 1.0 or ~> 2.0", [hex: :poison, optional: true]}, {:poolboy, "~> 1.4", [hex: :poolboy, optional: false]}, {:postgrex, "~> 0.11.0", [hex: :postgrex, optional: true]}, {:sbroker, "~> 0.7", [hex: :sbroker, optional: true]}]}, - "ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, + "ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"}, + "makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"}, "meck": {:hex, :meck, "0.8.4", "59ca1cd971372aa223138efcf9b29475bde299e1953046a0c727184790ab1520", [:rebar, :make], []}, - "mime": {:hex, :mime, "1.3.0", "5e8d45a39e95c650900d03f897fbf99ae04f60ab1daa4a34c7a20a5151b7a5fe", [:mix], [], "hexpm"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, + "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, + "nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"}, "pavlov": {:git, "https://github.com/sproutapp/pavlov.git", "7f3c0d7c75c8c2875e21b495511a291194bfc85a", []}, - "phoenix": {:hex, :phoenix, "1.4.0", "56fe9a809e0e735f3e3b9b31c1b749d4b436e466d8da627b8d82f90eaae714d2", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, - "phoenix_html": {:hex, :phoenix_html, "2.9.3", "1b5a2122cbf743aa242f54dced8a4f1cc778b8bd304f4b4c0043a6250c58e258", [:mix], [{:plug, "~> 1.0", [hex: :plug, optional: false]}]}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"}, - "plug": {:hex, :plug, "1.7.1", "8516d565fb84a6a8b2ca722e74e2cd25ca0fc9d64f364ec9dbec09d33eb78ccd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"}, - "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.5.3", "bfe0404e48ea03dfe17f141eff34e1e058a23f15f109885bbdcf62be303b49ff", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8e16febeb9640d8b33895a691a56481464b82836d338bb3a23125cd7b6157c25"}, + "phoenix_html": {:hex, :phoenix_html, "2.14.2", "b8a3899a72050f3f48a36430da507dd99caf0ac2d06c77529b1646964f3d563e", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "58061c8dfd25da5df1ea0ca47c972f161beb6c875cd293917045b92ffe1bf617"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"}, + "plug": {:hex, :plug, "1.10.3", "c9cebe917637d8db0e759039cc106adca069874e1a9034fd6e3fdd427fd3c283", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "01f9037a2a1de1d633b5a881101e6a444bcabb1d386ca1e00bb273a1f1d9d939"}, + "plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"}, "poison": {:hex, :poison, "2.2.0", "4763b69a8a77bd77d26f477d196428b741261a761257ff1cf92753a0d4d24a63", [:mix], [], "hexpm"}, "poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], []}, - "scrivener": {:hex, :scrivener, "2.2.1", "5a84cdfc042e3c318a03f965d8197b8294676a8fff7c4a29e482a90c467ebf19", [:mix], []}, + "scrivener": {:hex, :scrivener, "2.7.0", "fa94cdea21fad0649921d8066b1833d18d296217bfdf4a5389a2f45ee857b773", [:mix], [], "hexpm", "30da36a427f2519cf75993271fb7c5aad1759682a70f90d880a85c3d743d2c57"}, + "telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"}, } diff --git a/test/scrivener/html_test.exs b/test/scrivener/html_test.exs index 480c910..cd12b2f 100644 --- a/test/scrivener/html_test.exs +++ b/test/scrivener/html_test.exs @@ -318,7 +318,7 @@ defmodule Scrivener.HTMLTest do describe "Phoenix conn()" do test "handles no entries" do - use Phoenix.ConnTest + import Phoenix.ConnTest Application.put_env(:scrivener_html, :view_style, :bootstrap) Application.put_env(:scrivener_html, :routes_helper, MyApp.Router.Helpers) @@ -339,7 +339,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "active", 34]], 62, - [60, "a", [[32, "class", 61, 34, "", 34]], 62, "1", 60, 47, "a", 62], + [60, "a", [[32, "class", 61, 34, [], 34]], 62, "1", 60, 47, "a", 62], 60, 47, "li", @@ -366,7 +366,7 @@ defmodule Scrivener.HTMLTest do end test "allows other url parameters" do - use Phoenix.ConnTest + import Phoenix.ConnTest Application.put_env(:scrivener_html, :view_style, :bootstrap) Application.put_env(:scrivener_html, :routes_helper, MyApp.Router.Helpers) @@ -387,7 +387,7 @@ defmodule Scrivener.HTMLTest do end describe "View Styles" do - use Phoenix.ConnTest + import Phoenix.ConnTest test "renders Semantic UI styling" do assert {:safe, @@ -428,7 +428,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "current", 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "1", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "1", 60, 47, "span", 62], 60, 47, "li", @@ -437,9 +437,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "2", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "2", 60, 47, "span", 62], 60, 47, "li", @@ -448,14 +448,14 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, [ 60, "span", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - ">>", + [[[] | ">"] | ">"], 60, 47, "span", @@ -496,14 +496,14 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, [ 60, "span", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - "<<", + [[[] | "<"] | "<"], 60, 47, "span", @@ -517,9 +517,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "1", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "1", 60, 47, "span", 62], 60, 47, "li", @@ -528,9 +528,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "2", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "2", 60, 47, "span", 62], 60, 47, "li", @@ -541,7 +541,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "current", 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "3", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "3", 60, 47, "span", 62], 60, 47, "li", @@ -550,9 +550,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "4", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "4", 60, 47, "span", 62], 60, 47, "li", @@ -561,9 +561,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "5", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "5", 60, 47, "span", 62], 60, 47, "li", @@ -572,9 +572,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "6", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "6", 60, 47, "span", 62], 60, 47, "li", @@ -583,9 +583,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "7", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "7", 60, 47, "span", 62], 60, 47, "li", @@ -594,9 +594,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "8", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "8", 60, 47, "span", 62], 60, 47, "li", @@ -607,7 +607,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "ellipsis", 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, [], 60, 47, "span", 62], 60, 47, "li", @@ -616,9 +616,9 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - [60, "span", [[32, "class", 61, 34, "", 34]], 62, "10", 60, 47, "span", 62], + [60, "span", [[32, "class", 61, 34, [], 34]], 62, "10", 60, 47, "span", 62], 60, 47, "li", @@ -627,14 +627,14 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, [ 60, "span", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, - ">>", + [[[] | ">"] | ">"], 60, 47, "span", @@ -736,7 +736,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "active", 34]], 62, - [60, "a", [[32, "class", 61, 34, "", 34]], 62, "1", 60, 47, "a", 62], + [60, "a", [[32, "class", 61, 34, [], 34]], 62, "1", 60, 47, "a", 62], 60, 47, "li", @@ -747,7 +747,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "waves-effect", 34]], 62, - [60, "a", [[32, "class", 61, 34, "", 34]], 62, "2", 60, 47, "a", 62], + [60, "a", [[32, "class", 61, 34, [], 34]], 62, "2", 60, 47, "a", 62], 60, 47, "li", @@ -758,7 +758,7 @@ defmodule Scrivener.HTMLTest do "li", [[32, "class", 61, 34, "waves-effect", 34]], 62, - [60, "a", [[32, "class", 61, 34, "", 34]], 62, ">>", 60, 47, "a", 62], + [60, "a", [[32, "class", 61, 34, [], 34]], 62, [[[] | ">"] | ">"], 60, 47, "a", 62], 60, 47, "li", @@ -799,7 +799,7 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, [ 60, @@ -820,7 +820,7 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, [ 60, @@ -841,14 +841,14 @@ defmodule Scrivener.HTMLTest do [ 60, "li", - [[32, "class", 61, 34, "", 34]], + [[32, "class", 61, 34, [], 34]], 62, [ 60, "a", [[32, "class", 61, 34, "pagination-link", 34]], 62, - ">>", + [[[] | ">"] | ">"], 60, 47, "a", From e7d2ffcf241cebc8490da44b5d09ac297b57a91b Mon Sep 17 00:00:00 2001 From: Geoff Lane Date: Wed, 24 Jun 2020 10:21:13 -0400 Subject: [PATCH 2/2] Probably only going to work with Phoenix 1.5 --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 9147dee..be74532 100644 --- a/mix.exs +++ b/mix.exs @@ -49,7 +49,7 @@ defmodule ScrivenerHtml.Mixfile do [ {:scrivener, "~> 1.2 or ~> 2.0"}, {:phoenix_html, "~> 2.2"}, - {:phoenix, "~> 1.4", optional: true}, + {:phoenix, "~> 1.5", optional: true}, {:plug, "~> 1.1"}, {:ex_doc, "~> 0.19", only: :dev}, {:earmark, "~> 1.1", only: :dev}