VSCode Ruby設定
Extension
Ruby
ruby-rubocop
endwise
rails go to spec
コードジャンプ
Intellisenseを false から rubyLocate に変更
rspec
specファイルと実装ファイルとを行き来できる
cmd shift y
Tasks: Rerun Last Taskにcontrol + xを割り当てる
tasks.jsonに以下を記述
code:json
{
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "rspec file",
"type": "shell",
"command": "rspec -fd ${relativeFile}",
"group": "test",
"problemMatcher": [
{
"owner": "ruby",
"pattern": {
"regexp": "^rspec\\s+(.*):(\\d+)\\s+#\\s+(.*)$",
"file": 1,
"line": 2,
"message": 3
}
}
]
},
{
"label": "rspec here",
"type": "shell",
"command": "rspec -fd ${relativeFile}:${lineNumber}",
"group": "test",
"problemMatcher": [
{
"owner": "ruby",
"pattern": {
"regexp": "^rspec\\s+(.*):(\\d+)\\s+#\\s+(.*)$",
"file": 1,
"line": 2,
"message": 3
}
}
]
}
]
}
RSpecのテスト概要を見る
Rubocopの設定でフォーマットする