File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
lib/ruby_lsp/ruby_lsp_rspec Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,11 @@ def resolve_test_commands(items)
116116 elsif tags . include? ( "test_group" )
117117 start_line = item . dig ( :range , :start , :line )
118118 commands << "#{ @rspec_command } -r #{ FORMATTER_PATH } -f #{ FORMATTER_NAME } #{ path } :#{ start_line + 1 } "
119- else
119+ elsif tags . include? ( "test_case" )
120120 full_files << "#{ path } :#{ item . dig ( :range , :start , :line ) + 1 } "
121+ else
122+ # whole project
123+ full_files << path
121124 end
122125
123126 queue . concat ( children )
Original file line number Diff line number Diff line change 9292 ] )
9393 end
9494 end
95+
96+ it "resolves commands for the whole project" do
97+ project_uri = "file:///test-project"
98+ with_server do |server |
99+ server . process_message (
100+ {
101+ id : 1 ,
102+ method : "rubyLsp/resolveTestCommands" ,
103+ params : {
104+ items : [
105+ {
106+ id : project_uri ,
107+ label : "test-project" ,
108+ tags : [ "framework:rspec" ] ,
109+ uri : project_uri ,
110+ children : [ ] ,
111+ } ,
112+ ] ,
113+ } ,
114+ } ,
115+ )
116+
117+ response = pop_result ( server ) . response
118+ expect ( response [ :commands ] ) . to eq ( [
119+ "bundle exec rspec -r #{ formatter_absolute_path } -f #{ formatter_name } /test-project" ,
120+ ] )
121+ end
122+ end
95123 end
96124end
You can’t perform that action at this time.
0 commit comments