@@ -51,77 +51,77 @@ def temp_dir_relative_symlink_and_file_from_path(relative_path)
5151 def test_directory_absolute_symlink_support
5252 temp_dir_absolute_symlink_and_file_from_path ( "test.rb" ) do |dir , file |
5353 at = Brakeman ::AppTree . new ( dir , follow_symlinks : true )
54- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
54+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
5555 end
5656 end
5757
5858 def test_directory_relative_symlink_support
5959 temp_dir_relative_symlink_and_file_from_path ( "test.rb" ) do |dir , file |
6060 at = Brakeman ::AppTree . new ( dir , follow_symlinks : true )
61- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
61+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
6262 end
6363 end
6464
6565 def test_directory_relative_disabled_symlink_support
6666 temp_dir_relative_symlink_and_file_from_path ( "test.rb" ) do |dir , file |
6767 at = Brakeman ::AppTree . new ( dir , follow_symlinks : false )
68- assert_empty at . ruby_file_paths . collect ( &:absolute )
68+ assert_empty at . ruby_file_paths . collect ( &:absolute ) . to_a
6969 end
7070 end
7171
7272 def test_ruby_file_paths
7373 temp_dir_and_file_from_path ( "test.rb" ) do |dir , file |
7474 at = Brakeman ::AppTree . new ( dir )
75- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
75+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
7676 end
7777 end
7878
7979 def test_ruby_file_paths_skip_vendor_false
8080 temp_dir_and_file_from_path ( "vendor/test.rb" ) do |dir , file |
8181 at = Brakeman ::AppTree . new ( dir , :skip_vendor => false )
82- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
82+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
8383 end
8484 end
8585
8686 def test_ruby_file_paths_skip_vendor_true
8787 temp_dir_and_file_from_path ( "vendor/test.rb" ) do |dir , file |
8888 at = Brakeman ::AppTree . new ( dir , :skip_vendor => true )
89- assert_equal [ ] , at . ruby_file_paths . collect ( &:absolute )
89+ assert_equal [ ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
9090 end
9191 end
9292
9393 def test_ruby_file_paths_skip_vendor_true_add_libs_path
9494 temp_dir_and_file_from_path ( "vendor/bundle/gems/gem123/lib/test.rb" ) do |dir , file |
9595 at = Brakeman ::AppTree . new ( dir , :skip_vendor => true , :additional_libs_path => [ "vendor/bundle/gems/gem123/lib" ] )
96- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
96+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
9797 end
9898 end
9999
100100 def test_ruby_file_paths_skip_vendor_true_add_engine_path
101101 temp_dir_and_file_from_path ( "vendor/bundle/gems/gem123/test.rb" ) do |dir , file |
102102 at = Brakeman ::AppTree . new ( dir , :skip_vendor => true , :engine_paths => [ "vendor/bundle/gems" ] )
103- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
103+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
104104 end
105105 end
106106
107107 def test_ruby_file_paths_skip_vendor_true_tests_in_engine_path_still_excluded
108108 temp_dir_and_file_from_path ( "vendor/bundle/gems/gem123/test/test.rb" ) do |dir , file |
109109 at = Brakeman ::AppTree . new ( dir , :skip_vendor => true , :engine_paths => [ "vendor/bundler/gems" ] )
110- assert_equal [ ] , at . ruby_file_paths . collect ( &:absolute )
110+ assert_equal [ ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
111111 end
112112 end
113113
114114 def test_ruby_file_paths_add_engine_path
115115 temp_dir_and_file_from_path ( "lib/gems/gem123/test.rb" ) do |dir , file |
116116 at = Brakeman ::AppTree . new ( dir , :engine_paths => [ "lib/gems" ] )
117- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
117+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
118118 end
119119 end
120120
121121 def test_ruby_file_paths_add_libs_path
122122 temp_dir_and_file_from_path ( "gem123/lib/test.rb" ) do |dir , file |
123123 at = Brakeman ::AppTree . new ( dir , :additional_libs_path => [ "gems/gem123/lib" ] )
124- assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute )
124+ assert_equal [ file ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
125125 end
126126 end
127127
@@ -130,7 +130,7 @@ def test_ruby_file_paths_directory_with_rb_extension
130130 FileUtils . mkdir_p ( File . join ( dir , "test.rb" ) )
131131
132132 at = Brakeman ::AppTree . new ( dir )
133- assert_equal [ ] , at . ruby_file_paths . collect ( &:absolute )
133+ assert_equal [ ] , at . ruby_file_paths . collect ( &:absolute ) . to_a
134134 end
135135 end
136136end
0 commit comments