File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,15 +61,16 @@ def test_parse_takes_file_path
6161 assert_equal filepath , find_source_file_node ( parsed_result . value ) . filepath
6262 end
6363
64- Dir [ File . expand_path ( "fixtures/**/*.txt" , __dir__ ) ] . each do | filepath |
65- relative = filepath . delete_prefix ( " #{ File . expand_path ( "fixtures" , __dir__ ) } /" )
64+ base = File . join ( __dir__ , "fixtures" )
65+ Dir [ "**/*.txt" , base : base ] . each do | relative |
6666 next if known_failures . include? ( relative )
6767
68+ filepath = File . join ( base , relative )
6869 snapshot = File . expand_path ( File . join ( "snapshots" , relative ) , __dir__ )
6970 directory = File . dirname ( snapshot )
7071 FileUtils . mkdir_p ( directory ) unless File . directory? ( directory )
7172
72- define_method "test_filepath_#{ filepath } " do
73+ define_method "test_filepath_#{ relative } " do
7374 # First, read the source from the filepath. Use binmode to avoid converting CRLF on Windows,
7475 # and explicitly set the external encoding to UTF-8 to override the binmode default.
7576 source = File . read ( filepath , binmode : true , external_encoding : Encoding ::UTF_8 )
You can’t perform that action at this time.
0 commit comments