File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11GIT
22 remote: https://github.com/soutaro/steep.git
3- revision: 727014c361ae996a80b87948510c83ca480f5e82
3+ revision: 35bb7dc667a709d999105fe78b534b819afef6d7
44 specs:
5- steep (2.1.0.dev )
5+ steep (2.1.0.dev.1 )
66 concurrent-ruby (>= 1.1.10 )
77 csv (>= 3.0.9 )
88 fileutils (>= 1.1.0 )
5555 benchmark (0.5.0 )
5656 benchmark-ips (2.15.1 )
5757 bigdecimal (4.1.2 )
58- concurrent-ruby (1.3.6 )
58+ concurrent-ruby (1.3.8 )
5959 connection_pool (3.0.2 )
60- csv (3.3.5 )
60+ csv (3.3.6 )
6161 dbm (1.1.0 )
6262 diff-lcs (1.6.2 )
6363 digest (3.2.1 )
6464 drb (2.2.3 )
65- erb (6.0.6 )
65+ erb (6.0.7 )
6666 extconf_compile_commands_json (0.0.7 )
6767 ffi (1.17.4 )
6868 fileutils (1.8.0 )
7171 psych (>= 3.1 , < 5.0 )
7272 rainbow (>= 3.0 , < 4.0 )
7373 strong_json (>= 1.1 , < 2.2 )
74- i18n (1.14.8 )
74+ i18n (1.15.2 )
7575 concurrent-ruby (~> 1.0 )
76- io-console (0.8.2 )
76+ io-console (0.9.1 )
7777 irb (1.18.0 )
7878 pp (>= 0.6.0 )
7979 prism (>= 1.3.0 )
8080 rdoc (>= 4.0.0 )
8181 reline (>= 0.4.2 )
82- json (2.19.7 )
82+ json (2.21.2 )
8383 json-schema (6.2.0 )
8484 addressable (~> 2.8 )
8585 bigdecimal (>= 3.1 , < 5 )
86- language_server-protocol (3.17.0.5 )
86+ language_server-protocol (3.17.0.6 )
8787 lint_roller (1.1.0 )
8888 listen (3.10.0 )
8989 logger
@@ -101,14 +101,14 @@ GEM
101101 timeout
102102 net-smtp (0.5.1 )
103103 net-protocol
104- nkf (0.2 .0 )
104+ nkf (0.3 .0 )
105105 ostruct (0.6.3 )
106106 parallel (2.1.0 )
107- parser (3.3.11.1 )
107+ parser (3.3.12.0 )
108108 ast (~> 2.4.1 )
109109 racc
110110 power_assert (3.0.1 )
111- pp (0.6.3 )
111+ pp (0.6.4 )
112112 prettyprint
113113 prettyprint (0.2.0 )
114114 prism (1.9.0 )
134134 rbs (>= 4.0.0 )
135135 tsort
136136 regexp_parser (2.12.0 )
137- reline (0.6.3 )
137+ reline (0.7.0 )
138138 io-console (~> 0.5 )
139139 rspec (3.13.2 )
140140 rspec-core (~> 3.13.0 )
149149 diff-lcs (>= 1.2.0 , < 2.0 )
150150 rspec-support (~> 3.13.0 )
151151 rspec-support (3.13.7 )
152- rubocop (1.87 .0 )
152+ rubocop (1.89 .0 )
153153 json (~> 2.3 )
154154 language_server-protocol (~> 3.17.0.2 )
155155 lint_roller (~> 1.1.0 )
160160 rubocop-ast (>= 1.49.0 , < 2.0 )
161161 ruby-progressbar (~> 1.7 )
162162 unicode-display_width (>= 2.4.0 , < 4.0 )
163- rubocop-ast (1.49.1 )
163+ rubocop-ast (1.50.0 )
164164 parser (>= 3.3.7.2 )
165165 prism (~> 1.7 )
166166 rubocop-on-rbs (2.0.0 )
180180 tempfile (0.3.1 )
181181 terminal-table (4.0.0 )
182182 unicode-display_width (>= 1.1.1 , < 4 )
183- test-unit (3.7.7 )
183+ test-unit (3.7.8 )
184184 power_assert
185185 timeout (0.6.1 )
186186 tsort (0.2.0 )
Original file line number Diff line number Diff line change @@ -325,15 +325,11 @@ namespace :generate do
325325 class TestTemplateBuilder
326326 attr_reader :target , :env
327327
328- def initialize ( target )
328+ def initialize ( target , paths : )
329329 @target = target
330330
331331 loader = RBS ::EnvironmentLoader . new
332- Dir [ 'stdlib/*' ] . each do |lib |
333- next if lib . end_with? ( 'builtin' )
334-
335- loader . add ( library : File . basename ( lib ) )
336- end
332+ paths . each { loader . add ( path : Pathname ( _1 ) ) }
337333 @env = RBS ::Environment . from_loader ( loader ) . resolve_type_names
338334 end
339335
@@ -425,7 +421,7 @@ namespace :generate do
425421 end
426422 end
427423
428- path . write TestTemplateBuilder . new ( target ) . call
424+ path . write TestTemplateBuilder . new ( target , paths : args . extras ) . call
429425
430426 puts "Created: #{ path } "
431427 end
@@ -436,6 +432,8 @@ task :test_generate_stdlib do
436432 sh "ruby -c /tmp/Array_test.rb"
437433 sh "RBS_GENERATE_TEST_PATH=/tmp/Thread_Mutex_test.rb rake 'generate:stdlib_test[Thread::Mutex]'"
438434 sh "ruby -c /tmp/Thread_Mutex_test.rb"
435+ sh "RBS_GENERATE_TEST_PATH=/tmp/Kconv_test.rb rake 'generate:stdlib_test[Kconv,stdlib/nkf/0,stdlib/kconv/0]'"
436+ sh "ruby -c /tmp/Kconv_test.rb"
439437end
440438
441439# Pull requests with one of these labels are omitted from the changelog.
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ You will typically follow the steps as follows:
3333
34341 . Run ` rbs prototype runtime ` to generate list of methods.
35352 . Run ` rbs annotate ` to import RDoc comments.
36- 3 . Run ` rake generate:stdlib_test[LIB ] ` to generate a test case.
36+ 3 . Run ` rake generate:stdlib_test[CLASS,PATH,... ] ` to generate a test case. Pass the paths to the standard library signatures and their dependencies when needed .
37374 . Write the type definitions and tests.
3838
3939See the next * Useful Tools* section and the guides above for writing and testing RBS files.
Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ $ bundle exec rake 'generate:stdlib_test[String]'
1515Created: test/stdlib/String_test.rb
1616```
1717
18+ Core signatures are loaded by default. To generate a test for a class defined in standard library signatures,
19+ pass the paths containing those signatures and their dependencies after the class name.
20+
21+ ``` console
22+ $ bundle exec rake ' generate:stdlib_test[CSV::Row,stdlib/csv/0,stdlib/forwardable/0]'
23+ Created: test/stdlib/CSV_Row_test.rb
24+ ```
25+
1826It generates ` test/stdlib/[class_name]_test.rb ` .
1927The test scripts would look like the following:
2028
Original file line number Diff line number Diff line change 11GEM
22 remote: https://rubygems.org/
33 specs:
4- activesupport (8.1.3 )
4+ activesupport (8.1.3.1 )
55 base64
66 bigdecimal
77 concurrent-ruby (~> 1.0 , >= 1.3.1 )
1717 ast (2.4.3 )
1818 base64 (0.3.0 )
1919 bigdecimal (4.1.2 )
20- concurrent-ruby (1.3.6 )
20+ concurrent-ruby (1.3.8 )
2121 connection_pool (3.0.2 )
22- csv (3.3.5 )
22+ csv (3.3.6 )
2323 drb (2.2.3 )
2424 ffi (1.17.4 )
2525 fileutils (1.8.0 )
26- i18n (1.14.8 )
26+ i18n (1.15.2 )
2727 concurrent-ruby (~> 1.0 )
28- json (2.19.9 )
29- language_server-protocol (3.17.0.5 )
28+ json (2.21.2 )
29+ language_server-protocol (3.17.0.6 )
3030 listen (3.10.0 )
3131 logger
3232 rb-fsevent (~> 0.10 , >= 0.10.3 )
3636 drb (~> 2.0 )
3737 prism (~> 1.5 )
3838 mutex_m (0.3.0 )
39- parser (3.3.11.1 )
39+ parser (3.3.12.0 )
4040 ast (~> 2.4.1 )
4141 racc
4242 power_assert (3.0.1 )
4949 rbs (3.10.4 )
5050 logger
5151 tsort
52- ruby-lsp (0.26.9 )
52+ ruby-lsp (0.26.10 )
5353 language_server-protocol (~> 3.17.0 )
5454 prism (>= 1.2 , < 2.0 )
5555 rbs (>= 3 , < 5 )
7474 strscan (3.1.8 )
7575 terminal-table (4.0.0 )
7676 unicode-display_width (>= 1.1.1 , < 4 )
77- test-unit (3.7.7 )
77+ test-unit (3.7.8 )
7878 power_assert
7979 tsort (0.2.0 )
8080 tzinfo (2.0.6 )
You can’t perform that action at this time.
0 commit comments