File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change 1515# ```
1616#
1717module TestSkip
18- env = ENV [ "RBS_SKIP_TESTS" ]
19- SKIP_TESTS_FILE =
20- if env
21- Pathname ( env )
22- end
18+ SKIP_TESTS_FILES = ENV [ "RBS_SKIP_TESTS" ] &.split ( File ::PATH_SEPARATOR )
2319
2420 SKIP_TESTS =
25- if SKIP_TESTS_FILE
26- SKIP_TESTS_FILE . each_line . with_object ( { } ) do |line , hash |
21+ SKIP_TESTS_FILES &. each_with_object ( { } ) do | file , hash |
22+ File . foreach ( file ) do |line |
2723 line . chomp!
2824 line . gsub! ( /#.*/ , "" )
2925 line . strip!
@@ -32,19 +28,20 @@ module TestSkip
3228
3329 name , message = line . split ( /\s +/ , 2 )
3430
35- hash [ name ] = message
31+ hash [ name ] = [ file , message ]
3632 end
3733 end
3834
3935 if SKIP_TESTS
4036 def setup
4137 super
4238
43- if SKIP_TESTS . key? ( name ) || SKIP_TESTS . key? ( self . class . name )
44- if message = SKIP_TESTS [ name ] || SKIP_TESTS [ self . class . name ]
45- omit "Skip test by RBS_SKIP_TESTS(#{ SKIP_TESTS_FILE } ): #{ message } "
39+ file , message = SKIP_TESTS [ name ] || SKIP_TESTS [ self . class . name ]
40+ if file
41+ if message
42+ omit "Skip test by RBS_SKIP_TESTS(#{ file } ): #{ message } "
4643 else
47- omit "Skip test by RBS_SKIP_TESTS(#{ SKIP_TESTS_FILE } )"
44+ omit "Skip test by RBS_SKIP_TESTS(#{ file } )"
4845 end
4946 end
5047 end
@@ -54,7 +51,7 @@ def teardown
5451 when passed?
5552 # nop
5653 else
57- puts "💡You can skip this test `#{ name } ` by adding the name to `#{ SKIP_TESTS_FILE } `"
54+ puts "💡You can skip this test `#{ name } ` by adding the name to `#{ SKIP_TESTS_FILES . join ( '`, `' ) } `"
5855 end
5956
6057 super
You can’t perform that action at this time.
0 commit comments