File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,15 +34,16 @@ def test_parse_takes_file_path
3434 assert_equal filepath , find_source_file_node ( parsed_result . value ) . filepath
3535 end
3636
37- Dir [ File . expand_path ( "fixtures/**/*.txt" , __dir__ ) ] . each do | filepath |
38- relative = filepath . delete_prefix ( " #{ File . expand_path ( "fixtures" , __dir__ ) } /" )
37+ base = File . join ( __dir__ , "fixtures" )
38+ Dir [ "**/*.txt" , base : base ] . each do | relative |
3939 next if known_failures . include? ( relative )
4040
41+ filepath = File . join ( base , relative )
4142 snapshot = File . expand_path ( File . join ( "snapshots" , relative ) , __dir__ )
4243 directory = File . dirname ( snapshot )
4344 FileUtils . mkdir_p ( directory ) unless File . directory? ( directory )
4445
45- define_method "test_filepath_#{ filepath } " do
46+ define_method "test_filepath_#{ relative } " do
4647 # First, read the source from the filepath. Use binmode to avoid converting CRLF on Windows,
4748 # and explicitly set the external encoding to UTF-8 to override the binmode default.
4849 source = File . read ( filepath , binmode : true , external_encoding : Encoding ::UTF_8 )
You can’t perform that action at this time.
0 commit comments