Skip to content

Commit 81cb248

Browse files
authored
ruby: Improve Ruby test and debug task configurations (#36691)
Hi! This pull request adds missing `cwd` field to all Ruby test tasks otherwise `rdbg` will be broken when the user tries to debug a test. Thanks! Release Notes: - N/A
1 parent f2899bf commit 81cb248

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/src/languages/ruby.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ To run tests in your Ruby project, you can set up custom tasks in your local `.z
299299
"-n",
300300
"\"$ZED_CUSTOM_RUBY_TEST_NAME\""
301301
],
302+
"cwd": "$ZED_WORKTREE_ROOT",
302303
"tags": ["ruby-test"]
303304
}
304305
]
@@ -321,6 +322,7 @@ Plain minitest does not support running tests by line number, only by name, so w
321322
"-n",
322323
"\"$ZED_CUSTOM_RUBY_TEST_NAME\""
323324
],
325+
"cwd": "$ZED_WORKTREE_ROOT",
324326
"tags": ["ruby-test"]
325327
}
326328
]
@@ -334,6 +336,7 @@ Plain minitest does not support running tests by line number, only by name, so w
334336
"label": "test $ZED_RELATIVE_FILE:$ZED_ROW",
335337
"command": "bundle",
336338
"args": ["exec", "rspec", "\"$ZED_RELATIVE_FILE:$ZED_ROW\""],
339+
"cwd": "$ZED_WORKTREE_ROOT",
337340
"tags": ["ruby-test"]
338341
}
339342
]
@@ -369,7 +372,7 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name
369372
"label": "Debug Rails server",
370373
"adapter": "rdbg",
371374
"request": "launch",
372-
"command": "$ZED_WORKTREE_ROOT/bin/rails",
375+
"command": "./bin/rails",
373376
"args": ["server"],
374377
"cwd": "$ZED_WORKTREE_ROOT",
375378
"env": {

0 commit comments

Comments
 (0)