Commit 982f213c0bda9db837d6745d3a39c4e7df94eaf9

Michael Crumm 2022-03-28T10:51:42

Update unknown profile error, closes #23

diff --git a/lib/dart_sass.ex b/lib/dart_sass.ex
index 186bcaa..848a8f5 100644
--- a/lib/dart_sass.ex
+++ b/lib/dart_sass.ex
@@ -103,11 +103,11 @@ defmodule DartSass do
   def config_for!(profile) when is_atom(profile) do
     Application.get_env(:dart_sass, profile) ||
       raise ArgumentError, """
-      unknown dart_sass profile. Make sure the profile is defined in your config files, such as:
+      unknown dart_sass profile. Make sure the profile named #{inspect(profile)} is defined in your config files, such as:
 
           config :dart_sass,
             #{profile}: [
-              args: ~w(css/app.scss ../priv/static/assets/app.css),
+              args: ~w(css/app.scss:../priv/static/assets/app.css),
               cd: Path.expand("../assets", __DIR__)
             ]
       """
diff --git a/test/dart_sass_test.exs b/test/dart_sass_test.exs
index 7b6b4d2..09f392b 100644
--- a/test/dart_sass_test.exs
+++ b/test/dart_sass_test.exs
@@ -33,6 +33,14 @@ defmodule DartSassTest do
            end) =~ @version
   end
 
+  test "errors on invalid profile" do
+    assert_raise ArgumentError,
+                 ~r<unknown dart_sass profile. Make sure the profile named :"assets/css/app.scss" is defined>,
+                 fn ->
+                   assert DartSass.run(:"assets/css/app.scss", ["../priv/static/assets/app.css"])
+                 end
+  end
+
   @tag :tmp_dir
   test "compiles", %{tmp_dir: dir} do
     dest = Path.join(dir, "app.css")