@@ -5,6 +5,7 @@ Mix.shell(Mix.Shell.Process)
55defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
66 use ExUnit.Case
77 alias PhoenixOauth2Provider.Test.MixHelpers
8+ alias Mix.Tasks.PhoenixOauth2Provider.Install
89
910 defmodule MigrationsRepo do
1011 def __adapter__ do
@@ -24,8 +25,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
2425
2526 test "generates files for application" do
2627 MixHelpers . in_tmp "generates_files_for_application" , fn ->
27- ~w( --repo PhoenixOauth2Provider.Test.Repo --log-only --controllers --module PhoenixOauth2Provider.Test --no-provider)
28- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
28+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --log-only --controllers --module PhoenixOauth2Provider.Test --no-provider) )
2929
3030 ~w( application_view.ex authorization_view.ex authorized_application_view.ex phoenix_oauth2_provider_view.ex layout_view.ex phoenix_oauth2_provider_view_helpers.ex)
3131 |> MixHelpers . assert_file_list ( @ all_views , web_path ( "views/phoenix_oauth2_provider/" ) )
@@ -44,8 +44,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
4444
4545 test "does not generate files for full" do
4646 MixHelpers . in_tmp "does_not_generate_files_for_full" , fn ->
47- ~w( --repo PhoenixOauth2Provider.Test.Repo --full --log-only --no-boilerplate --no-provider)
48- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
47+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --full --log-only --no-boilerplate --no-provider) )
4948
5049 MixHelpers . assert_file_list ( [ ] , @ all_views , web_path ( "views/phoenix_oauth2_provider/" ) )
5150
@@ -59,8 +58,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
5958 MixHelpers . in_tmp "installs_phoenix_oauth2_provider_config" , fn ->
6059 file_path = "config.exs"
6160 File . touch! ( file_path )
62- ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --no-migrations --config-file #{ File . cwd! } /#{ file_path } )
63- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
61+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --no-migrations --config-file #{ File . cwd! } /#{ file_path } ) )
6462
6563 MixHelpers . assert_file file_path , fn file ->
6664 assert file =~ "config :phoenix_oauth2_provider, PhoenixOauth2Provider"
@@ -77,8 +75,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
7775
7876 test "instructions" do
7977 MixHelpers . in_tmp "prints_instructions" , fn ->
80- ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --no-migrations --no-config)
81- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
78+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --no-migrations --no-config) )
8279
8380 assert_received { :mix_shell , :info , [
8481 """
@@ -124,8 +121,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
124121 """
125122 ] }
126123
127- ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --controllers --no-migrations --no-config)
128- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
124+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --controllers --no-migrations --no-config) )
129125
130126 assert_received { :mix_shell , :info , [
131127 """
@@ -162,8 +158,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
162158
163159 describe "installs ex_oauth2_provider" do
164160 test "adds migrations" do
165- ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --no-config --repo #{ to_string MigrationsRepo } )
166- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
161+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --no-boilerplate --no-config --repo #{ to_string MigrationsRepo } ) )
167162
168163 assert [ _ ] = MixHelpers . tmp_path ( ) |> Path . join ( "migrations/*_create_oauth_tables.exs" ) |> Path . wildcard ( )
169164 assert_received { :mix_shell , :info , [
@@ -178,8 +173,7 @@ defmodule Mix.Tasks.PhoenixOauth2Provider.InstallTest do
178173 describe "installed options" do
179174 test "install options default" do
180175 Application . put_env :phoenix_oauth2_provider , :opts , [ :application ]
181- ~w( --repo PhoenixOauth2Provider.Test.Repo --installed-options --no-provider)
182- |> Mix.Tasks.PhoenixOauth2Provider.Install . run ( )
176+ Install . run ( ~w( --repo PhoenixOauth2Provider.Test.Repo --installed-options --no-provider) )
183177
184178 assert_received { :mix_shell , :info , [ "mix phoenix_oauth2_provider.install --application" ] }
185179 end
0 commit comments