From c18037c5a4985bc9c761ef0925dfbe65c829e418 Mon Sep 17 00:00:00 2001 From: Zach Allaun Date: Tue, 12 Nov 2024 12:51:04 -0500 Subject: [PATCH] chore: bump igniter and update tests --- mix.lock | 2 +- test/mix/tasks/mneme.install_test.exs | 27 +++++++-------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/mix.lock b/mix.lock index e2fc1fc..8cb9f19 100644 --- a/mix.lock +++ b/mix.lock @@ -22,7 +22,7 @@ "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "owl": {:hex, :owl, "0.12.0", "0c4b48f90797a7f5f09ebd67ba7ebdc20761c3ec9c7928dfcafcb6d3c2d25c99", [:mix], [{:ucwidth, "~> 0.2", [hex: :ucwidth, repo: "hexpm", optional: true]}], "hexpm", "241d85ae62824dd72f9b2e4a5ba4e69ebb9960089a3c68ce6c1ddf2073db3c15"}, "patch": {:hex, :patch, "0.14.0", "34820b7790fbb76d3214e35cb6548210bda00ed1a224b36bb3195daa4a71dd68", [:mix], [], "hexpm", "8d0592a40d64791c36fcbc7dbe368d0436ec166b9561b2fa6358cb2bab17cfa6"}, - "rewrite": {:hex, :rewrite, "1.0.1", "2a249d703e47c050ad251fa43a3d019d4c08159ead95ec30ef48357ba88af609", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}, {:text_diff, "~> 0.1", [hex: :text_diff, repo: "hexpm", optional: false]}], "hexpm", "79869f0bdb22840cf233b99e0dc7b6682a35d7e4747bdf2e78d3bc156b2c7c14"}, + "rewrite": {:hex, :rewrite, "1.1.0", "69f869fd6460cde30ae90b09895e42d1840cbdb903802650a28a6959c4777971", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}, {:text_diff, "~> 0.1", [hex: :text_diff, repo: "hexpm", optional: false]}], "hexpm", "adcdd3623a055703c8ecfe4dd24f695ff9d9e1ec6b09c023080999808ff4096e"}, "sourceror": {:hex, :sourceror, "1.7.1", "599d78f4cc2be7d55c9c4fd0a8d772fd0478e3a50e726697c20d13d02aa056d4", [:mix], [], "hexpm", "cd6f268fe29fa00afbc535e215158680a0662b357dc784646d7dff28ac65a0fc"}, "spitfire": {:hex, :spitfire, "0.1.3", "7ea0f544005dfbe48e615ed90250c9a271bfe126914012023fd5e4b6b82b7ec7", [:mix], [], "hexpm", "d53b5107bcff526a05c5bb54c95e77b36834550affd5830c9f58760e8c543657"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, diff --git a/test/mix/tasks/mneme.install_test.exs b/test/mix/tasks/mneme.install_test.exs index 4cbd1c7..9a2bf73 100644 --- a/test/mix/tasks/mneme.install_test.exs +++ b/test/mix/tasks/mneme.install_test.exs @@ -4,19 +4,6 @@ defmodule Mix.Tasks.Mneme.InstallTest do import Igniter.Test - defp igniter_diff(igniter, opts \\ []) do - sources = - if opts[:only] do - Enum.filter(igniter.rewrite.sources, fn {_, source} -> - source.path in List.wrap(opts[:only]) - end) - else - igniter.rewrite.sources - end - - Igniter.diff(sources, color?: false) - end - test "mix mneme.install performs all setup when a project hasn't installed Mneme" do auto_assert """ Update: .formatter.exs @@ -51,7 +38,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do 2 + |Mneme.start() - """ <- test_project() |> Igniter.compose_task("mneme.install") |> igniter_diff() + """ <- test_project() |> Igniter.compose_task("mneme.install") |> diff() end describe "mix.exs" do @@ -93,7 +80,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do """ <- test_project |> Igniter.compose_task("mneme.install") - |> igniter_diff(only: "mix.exs") + |> diff(only: "mix.exs") end test "when :preferred_cli_env already contains mneme tasks" do @@ -121,7 +108,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do auto_assert "" <- test_project |> Igniter.compose_task("mneme.install") - |> igniter_diff(only: "mix.exs") + |> diff(only: "mix.exs") end test "when :preferred_cli_env already contains only mneme.watch" do @@ -161,7 +148,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do """ <- test_project |> Igniter.compose_task("mneme.install") - |> igniter_diff(only: "mix.exs") + |> diff(only: "mix.exs") end test "when :preferred_cli_env is a call to a local function" do @@ -205,7 +192,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do """ <- test_project |> Igniter.compose_task("mneme.install") - |> igniter_diff(only: "mix.exs") + |> diff(only: "mix.exs") end end @@ -224,7 +211,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do auto_assert "" <- test_project |> Igniter.compose_task("mneme.install") - |> igniter_diff(only: "test/test_helper.exs") + |> diff(only: "test/test_helper.exs") end test "when ExUnit.start/1 has options" do @@ -246,7 +233,7 @@ defmodule Mix.Tasks.Mneme.InstallTest do """ <- test_project |> Igniter.compose_task("mneme.install") - |> igniter_diff(only: "test/test_helper.exs") + |> diff(only: "test/test_helper.exs") end end end