docs: Update Rails test task to run using name (#28574)
The author of Rails' minitest integration [recommended](https://github.com/zed-extensions/ruby/issues/56#issuecomment-2795010202) using the test name rather than line number. This solves the problem in https://github.com/zed-extensions/ruby/issues/56. Note that everything is within `command`. I first tried using `args`: ```json { "command": "bin/rails", "args": ["test", "$ZED_RELATIVE_FILE -n /$ZED_SYMBOL/"], "tags": ["ruby-test"] } ``` but minitest receives this as: ``` Run options: -n "/\"foo bar\"/" --seed 31855 ``` which doesn't match due to the escaping. Release Notes: - N/A
This commit is contained in:
parent
35da1502e1
commit
1eb948654a
1 changed files with 4 additions and 3 deletions
|
@ -291,14 +291,15 @@ To run tests in your Ruby project, you can set up custom tasks in your local `.z
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": "test $ZED_RELATIVE_FILE:$ZED_ROW",
|
"label": "test $ZED_RELATIVE_FILE -n /$ZED_SYMBOL/",
|
||||||
"command": "bin/rails",
|
"command": "bin/rails test $ZED_RELATIVE_FILE -n /$ZED_SYMBOL/",
|
||||||
"args": ["test", "\"$ZED_RELATIVE_FILE:$ZED_ROW\""],
|
|
||||||
"tags": ["ruby-test"]
|
"tags": ["ruby-test"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: We can't use `args` here because of the way quotes are handled.
|
||||||
|
|
||||||
### Minitest
|
### Minitest
|
||||||
|
|
||||||
Plain minitest does not support running tests by line number, only by name, so we need to use `$ZED_SYMBOL` instead:
|
Plain minitest does not support running tests by line number, only by name, so we need to use `$ZED_SYMBOL` instead:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue