2024-09-26 Rspec on Zed Editor
ZedエディタでRspecをさくっと走らせたい。
追記(2025-04-05)
公式ドキュメントで下記のように設定が書かれていた。
To run tests in your Ruby project, you can set up custom tasks in your local
.zed/tasks.json
configuration file.
[
{
"label": "test $ZED_RELATIVE_FILE:$ZED_ROW",
"command": "bundle exec rspec",
"args": ["\"$ZED_RELATIVE_FILE:$ZED_ROW\""],
"tags": ["ruby-test"]
}
]
ref. Ruby - Zed
下記の設定を .zed/tasks.json
に追加すれば動いた。
[
{
"label": "rspec $ZED_RELATIVE_FILE:$ZED_ROW",
"command": "bin/rspec",
"args": ["$ZED_RELATIVE_FILE:$ZED_ROW"],
"tags": ["ruby-test"],
"use_new_terminal": false,
"allow_concurrent_runs": false
}
]
ちなみに、現状のZed標準のRubyタスク設定は下記の通りで、自分で設定する必要がある。
https://github.com/zed-industries/zed/blob/main/extensions/ruby/languages/ruby/tasks.json
[
{
"label": "test $ZED_RELATIVE_FILE:$ZED_ROW",
"command": "echo 'To run tests, configure tasks in your \".zed/tasks.json\" file as described in the Ruby extension documentation.'",
"tags": ["ruby-test"]
}
]