@@ -16,8 +16,16 @@ defmodule Mix.Tasks.NewTest do
1616 assert file =~ "version: \" 0.1.0\" "
1717 end )
1818
19- assert_file ( "hello_world/README.md" , ~r/ # HelloWorld\n / )
20- assert_file ( "hello_world/.gitignore" )
19+ assert_file ( "hello_world/README.md" , fn file ->
20+ assert file =~ "# HelloWorld\n "
21+ assert String . ends_with? ( file , "\n " )
22+ refute String . ends_with? ( file , "\n \n " )
23+ end )
24+
25+ assert_file ( "hello_world/.gitignore" , fn file ->
26+ assert String . ends_with? ( file , "\n " )
27+ refute String . ends_with? ( file , "\n \n " )
28+ end )
2129
2230 assert_file ( "hello_world/lib/hello_world.ex" , ~r/ defmodule HelloWorld do/ )
2331 assert_file ( "hello_world/test/test_helper.exs" , ~r/ ExUnit.start()/ )
@@ -118,8 +126,16 @@ defmodule Mix.Tasks.NewTest do
118126 assert file =~ "apps_path: \" apps\" "
119127 end )
120128
121- assert_file ( "hello_world/README.md" , ~r/ # HelloWorld\n / )
122- assert_file ( "hello_world/.gitignore" )
129+ assert_file ( "hello_world/README.md" , fn file ->
130+ assert file =~ "# HelloWorld\n "
131+ assert String . ends_with? ( file , "\n " )
132+ refute String . ends_with? ( file , "\n \n " )
133+ end )
134+
135+ assert_file ( "hello_world/.gitignore" , fn file ->
136+ assert String . ends_with? ( file , "\n " )
137+ refute String . ends_with? ( file , "\n \n " )
138+ end )
123139
124140 assert_received { :mix_shell , :info , [ "* creating mix.exs" ] }
125141
0 commit comments