File tree Expand file tree Collapse file tree 3 files changed +9
-26
lines changed Expand file tree Collapse file tree 3 files changed +9
-26
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
# frozen_string_literal: true
3
3
4
- # Append to RUBYOPT the necessary requires to hook our custom test reporters so that results are automatically
5
- # reflected in the test explorer
6
- rubyopt = [
7
- *ENV [ "RUBYOPT" ] ,
8
- "-rbundler/setup" ,
9
- "-r#{ File . expand_path ( "../lib/ruby_lsp/test_reporters/minitest_reporter" , __dir__ ) } " ,
10
- "-r#{ File . expand_path ( "../lib/ruby_lsp/test_reporters/test_unit_reporter" , __dir__ ) } " ,
11
- ] . join ( " " )
12
-
13
- # Replace this process with whatever command was passed. We only want to set RUBYOPT.
14
- # The way you use this executable is by prefixing your test command with `ruby-lsp-test-exec`, like so:
15
- # ruby-lsp-test-exec bundle exec ruby -Itest test/example_test.rb
16
- # ruby-lsp-test-exec bundle exec ruby -Ispec spec/example_spec.rb
17
- # ruby-lsp-test-exec bundle exec rspec spec/example_spec.rb
18
- exec ( { "RUBYOPT" => rubyopt } , *ARGV )
4
+ # This executable will be removed thanks to the changes in https://github.com/Shopify/ruby-lsp/pull/3661.
5
+ # Remove this a few months after extension updates have rolled out
6
+ exec ( *ARGV )
Original file line number Diff line number Diff line change @@ -119,16 +119,13 @@ items accept metadata. This scenario will not be supported by the Ruby LSP.
119
119
120
120
## Connecting terminal tests to the explorer
121
121
122
- When running tests in the terminal through a code lens or test explorer, the Ruby LSP uses the ` ruby-lsp-test-exec `
123
- executable, which hooks the test run to the extension so that we can show test results in the explorer.
124
-
125
- By running tests with this executable, even manually written test commands will also have their results reported
126
- to the test explorer. For example, all of the following will report test statuses to the extension:
122
+ When running tests in the terminal through a code lens or test explorer, the Ruby LSP and add-ons will hook up the
123
+ execution commands with the expected reporters using the ` -r ` argument for ` ruby ` . You can manually hook up execution
124
+ by adding the same.
127
125
128
126
``` shell
129
- ruby-lsp-test-exec bundle exec ruby -Itest test/example_test.rb
130
- ruby-lsp-test-exec bundle exec ruby -Ispec spec/example_spec.rb
131
- ruby-lsp-test-exec bundle exec rspec spec/example_spec.rb
127
+ bundle exec ruby -r/path/to/ruby-lsp/reporter -Itest test/example_test.rb
128
+ bundle exec ruby -r/path/to/ruby-lsp/reporter -Ispec spec/example_spec.rb
132
129
```
133
130
134
131
## Customization
Original file line number Diff line number Diff line change @@ -148,9 +148,7 @@ export class StreamingRunner implements vscode.Disposable {
148
148
this . terminals . set ( name , terminal ) ;
149
149
150
150
terminal . show ( ) ;
151
- const exec =
152
- path . basename ( cwd ) === "ruby-lsp" && os . platform ( ) !== "win32" ? "exe/ruby-lsp-test-exec" : "ruby-lsp-test-exec" ;
153
- terminal . sendText ( `${ exec } ${ command } ` ) ;
151
+ terminal . sendText ( command ) ;
154
152
}
155
153
156
154
// Spawns the test process and redirects any stdout or stderr output to the test run output
You can’t perform that action at this time.
0 commit comments