Skip to content

Commit c32e7c4

Browse files
committed
Setup tasks for rspec
Note that you will need to have asdf on your non-interactive shell path for this to work. If you see a bunder not installed message this is likely the cause. You can fix this by making sure asdf is added to your path in your zprofile instead of your zshrc. I've added the rspec bin stub as part of this as it's quicker than typing bundle exec and simpler than using it in the tasks.json
1 parent 654dcd3 commit c32e7c4

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.vscode/tasks.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Run test file (RSpec)",
6+
"type": "shell",
7+
"command": "./bin/rspec",
8+
"args": [
9+
"${file}"
10+
],
11+
"options": {
12+
"cwd": "${workspaceFolder}"
13+
},
14+
"group": "test",
15+
"presentation": {
16+
"reveal": "always",
17+
"panel": "dedicated",
18+
"clear": true
19+
},
20+
"problemMatcher": []
21+
},
22+
{
23+
"label": "Run test at current line (RSpec)",
24+
"type": "shell",
25+
"command": "./bin/rspec",
26+
"args": [
27+
"${file}:${lineNumber}"
28+
],
29+
"options": {
30+
"cwd": "${workspaceFolder}"
31+
},
32+
"group": "test",
33+
"presentation": {
34+
"reveal": "always",
35+
"panel": "dedicated",
36+
"clear": true
37+
},
38+
"problemMatcher": []
39+
}
40+
]
41+
}

bin/rspec

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rspec' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
require "rubygems"
14+
require "bundler/setup"
15+
16+
load Gem.bin_path("rspec-core", "rspec")

0 commit comments

Comments
 (0)